Can't handle complex filter attribute

62 views
Skip to first unread message

Vitaly

unread,
May 3, 2012, 9:42:25 AM5/3/12
to DotLess (Less Css for .NET)
Example of CSS in my project that DotLess fails to process:

.bgMask
{
display:none;
position:fixed;
z-index:1000;
background:rgb(0,0,0);
background: transparent\9;
background:rgba(0,0,0,0.7);

filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#b2000000,endColorstr=#b2000000);
zoom: 1;
}

The culprit is line with the 'filter' attribute. In this context it is
used as a hack for IE gradient implementation. Unfortunately, just
DotLess encounters it, it fails, and as a result, the entire CSS comes
up as an empty file.

Took me a while to find out why my CSS was returned empty by DotLess,
but here it is...

I hope there will be a fix soon, so I can start using this otherwise
great project.

Cheers!

Sven Nicolai Viig

unread,
May 3, 2012, 9:49:38 AM5/3/12
to dot...@googlegroups.com
Try to escape it, from the  http://lesscss.org/ documentation
---
Escaping

Sometimes you might need to output a CSS value which is either not valid CSS syntax, or uses proprietary syntax which LESS doesn’t recognize.

To output such value, we place it inside a string prefixed with ~, for example:

.class {
  filter: ~"ms:alwaysHasItsOwnSyntax.For.Stuff()";
}
This is called an “escaped value”, which will result in:

.class {
  filter: ms:alwaysHasItsOwnSyntax.For.Stuff();
}
---


--
You received this message because you are subscribed to the Google Groups "DotLess (Less Css for .NET)" group.
To post to this group, send email to dot...@googlegroups.com.
To unsubscribe from this group, send email to dotless+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dotless?hl=en.


Vitaly

unread,
May 3, 2012, 9:53:20 AM5/3/12
to DotLess (Less Css for .NET)
A-ha! that did that trick! Thank you!!!!!

And thank you twice for such a prompt answer! ;)


On May 3, 2:49 pm, Sven Nicolai Viig <sven.v...@gmail.com> wrote:
> Try to escape it, from the  http://lesscss.org/documentation
> ---
> Escaping
>
> Sometimes you might need to output a CSS value which is either not valid
> CSS syntax, or uses proprietary syntax which LESS doesn’t recognize.
>
> To output such value, we place it inside a string prefixed with ~, for
> example:
>
> .class {
>   filter: ~"ms:alwaysHasItsOwnSyntax.For.Stuff()";}
>
> This is called an “escaped value”, which will result in:
>
> .class {
>   filter: ms:alwaysHasItsOwnSyntax.For.Stuff();}
>
> ---
>
Reply all
Reply to author
Forward
0 new messages