Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment entities #458

Merged
merged 5 commits into from
Nov 25, 2011
Merged

Assignment entities #458

merged 5 commits into from
Nov 25, 2011

Conversation

fat
Copy link
Contributor

@fat fat commented Nov 13, 2011

This is my attempt at adding support for filter properties - which currently can't be parsed.

This allows them to be parsed and also adds support for passing variables directly into them - which is pretty neat and I think a lot nicer than having to use % and e

To get this done I had to add a new entity type called "assignment" and also allow the call parser to detect progid: types.

I added a few tests where you can see it in action - all tests still pass and the benchmarks are consistent with master.

I also built a browser version and tried that with great success :)

@matthew-dean
Copy link
Member

What are you talking about? Filters can be parsed. There's an example right on lesscss.org. And you can add variables into them. ^_^

@fat
Copy link
Contributor Author

fat commented Nov 24, 2011

Actually you're incorrect. Currently you have to escape filters using something like this (straight from lesscss.org):

filter: ~"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png')"

If you want to use variables you have to use the % and e substitution hack. Give it a try.

@fat
Copy link
Contributor Author

fat commented Nov 24, 2011

If it's not clear, this pull request allows you to write them out like this:

filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png')

No quotes, not escaping. Just regular css.

you can also use variables and other entities inline just like other css properties in less:

filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=@mySrcVar)

It's a bummer right now that you have to escape everything because that means that the amazing less tokenizer that @cloudhead wrote can't be used to parse regular css.

@matthew-dean
Copy link
Member

Interesting. I don't use filters so I've never tried it out.

@fat
Copy link
Contributor Author

fat commented Nov 24, 2011

We need this in bootstrap. filter's for cross browser gradients/alpha.

@matthew-dean
Copy link
Member

I suppose. Only if you're not willing to use CSS3Pie. ;-)

@cloudhead
Copy link
Member

Thanks love!

Also, don't forget you can interpolate inside strings "foo @{bar}" since 1.1, instead of using %("foo %s", @bar).

cloudhead pushed a commit that referenced this pull request Nov 25, 2011
@cloudhead cloudhead merged commit 9200342 into less:master Nov 25, 2011
@fat
Copy link
Contributor Author

fat commented Nov 25, 2011

hooray! thank you sir!!

stefanklug pushed a commit to stefanklug/carto that referenced this pull request Jan 27, 2019
add possibility of global _properties object in MML
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants