Comments (8)
I like both of these ideas. The only issue I see is that special IE functions already support the syntax but the compiler would output in rgba()
eg.
filter: progid:DXImageTransform.Microsoft.gradient(enabled='false', startColorstr=#550000FF, endColorstr=#55FFFF00);
would turn into
filter: progid:DXImageTransform.Microsoft.gradient(enabled='false', startColorstr=rgba(85,0,0,1), endColorstr=rgba(85,255,255,0));
do you think that would be problem?
from lessphp.
Yeah I'm thinking about this to. Is it possible to detect the context of usage rgba color? If it is IE filter, return the filter syntax, else rgba(...);?
By the way thanks for implementing all of my ideas! ;)
from lessphp.
Actually it would not... Less cann't see colors used in filter. Can I somehow use a variabli in filter value? I couldn't figure it out.
from lessphp.
Is there any way to know, what property is being compile in lessc::compileValue method? That could solve this problem with filter. There is also similar issue with -webkit-border-radius.
from lessphp.
Well apparently not. But we could do something like this:
$property = ''; function compileProperty($name, $value, $level = 0) { foreach ($value as $v) { $this->property = $name; $props[] = str_repeat(' ', $level).$name.':'.$this->compileValue($v).';'; } return implode("\n", $props); }
Then we can simply test variable $this->property in compileValue method. It is an ugly hack, but I noticed that compileValue is called from many places, so it might be a problem to do this through second parametr of compileValue. What do you think?
from lessphp.
I would tell what I am currently in by pushing the name of what I am entering on a stack at the start of compile value, and then popping it at the end. (the name of the property shouldn't matter, we just need to know that we are in a microsoft specific function in the value)
from lessphp.
Not only. Like i've said, there is also some difference between -webkit-border-radius and (-moz-)border-radius. For example:
/* this is equivalent: */ -webkit-border-radius: 40px 10px; -moz-border-radius: 40px/10px; border-radius: 40px/10px;
It's copy + paste from this site:
https://developer.mozilla.org/en/CSS/-moz-border-radius
from lessphp.
Ok, I've solved border-radius issue by mixins. But what with those filters? Without solution to this filters are limited to rgb. Well i think we have 2 options - some global flag whether we are in filter property or second argument for compileValue method (with same purpose).
from lessphp.
Related Issues (20)
- parse error: failed at `$result: &;` (stdin) HOT 1
- Will the project uodated to teh newest less version? HOT 2
- @supports CSS Feature Queries not working HOT 3
- Both DOS and UNIX style line endings issue on Theme Check WordPress Plugin
- guarded recursion fails on exit
- setPreserveComments changes line endings
- Parse error with CSS Grid Layout and named grid lines/areas HOT 3
- lessphp fatal error: expected color value: /home/iler/public_html/wp-content/themes/CherryFramework-child2/bootstrap/less/bootstrap.less on line 63
- less parser fails with UIKIT 3 less files HOT 3
- less parser fails with less.js built-in function color() HOT 1
- recursive mixin not working in nested rule
- Background SVG animation breaks generation
- PHP Fatal error: Uncaught Exception: E_NOTICE in PHP 7.4 HOT 3
- Error parse: calc function HOT 1
- Deprecated Array and string offset access syntax with curly braces is deprecated HOT 5
- Imported files get optimized incorrectly. HOT 1
- Deprecated stuff under PHP 8.1 HOT 3
- each loop -> Uncaught Exception: parse error: failed at `); `
- Support for PHP 8.2 HOT 4
- Deprecated things under PHP 8.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lessphp.