CSS Handler Path Issue

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
9/16/2013 11:18:52 AM
Gravatar
Total Posts 91

mojoPortal Hosting & Design @ i7MEDIA!

CSS Handler Path Issue

Joe,

I've found an issue with the CSS hander when a CSS property has more than one URL in it, such as a @font-face declaration or multiple backgrounds.  The first occurring URL gets the correct path, but the others are ignored.  Here's an example:

@font-face {
	font-family: 'Glyphicons Halflings';
	src: url('/Data/Sites/1/skins/micromo-mobile-dev/fonts/glyphicons-halflings-regular.eot');
	src: url('/Data/Sites/1/skins/micromo-mobile-dev/fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('fonts/glyphicons-halflings-regular.woff') format('woff'), url('fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
}

This can cause some pretty big issues as you can see, I hope you can fix it easily.

Thanks,
-Elijah

9/16/2013 11:41:57 AM
Gravatar
Total Posts 18439

Re: CSS Handler Path Issue

I don't think I can solve it, however if you put each comma separated url on a new line I think that will solve it.

Hope that helps,

Joe

9/16/2013 12:56:43 PM
Gravatar
Total Posts 91

mojoPortal Hosting & Design @ i7MEDIA!

Re: CSS Handler Path Issue

That's unfortunate.  I knew that you could get around the issue by placing each one on separate lines, which works when you are doing everything by hand, but when using a Preprocessor like Sass/Less/Stylus that automatically generates the CSS it generates it inline (which is technically the right way to do it). So even if you change the CSS by hand, every time you change/save the file you lose those changes.

Thanks for the help though,
-Elijah

9/16/2013 1:42:38 PM
Gravatar
Total Posts 18439

Re: CSS Handler Path Issue

CSS Handler has already grown too heavy, I'm beginning to think the best way is to pre-combine the css into one css file and link to the one pre-combined file, see this thread where I explained how to do that to help someone solve a performance problem on go daddy, I'm thinking this is good advice even in better hosting to remove the design processing tools out of the chain of servicing web requests.

9/16/2013 3:17:56 PM
Gravatar
Total Posts 91

mojoPortal Hosting & Design @ i7MEDIA!

Re: CSS Handler Path Issue

That's more or less the way I've been developing, I use a desktop preprocessor and combine everything with the preprocessor.  I would even like to minify it, but I run into a similar problem with the URLs in the CSS file not getting added.  If it was my own site I would add the file path in by hand (it's real easy with LESS or Sass, just create a variable with the path and then call it for each URL), but I can't do that for our clients.

On another note, it's too bad we have to include all the styles together in one file, it creates unnecessary bloat for most of the site.  It would be awesome if we could create a dynamic solution that only pulls certain CSS in for it's matching modules/pages.  I'm sure that would be a lot of work though. Just a thought.

Thanks again,
-Elijah

You must sign in to post in the forums. This thread is closed to new posts.