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

Code reuse for browser inconsistencies. #416

Closed
jaseemabid opened this issue Oct 4, 2011 · 6 comments
Closed

Code reuse for browser inconsistencies. #416

jaseemabid opened this issue Oct 4, 2011 · 6 comments

Comments

@jaseemabid
Copy link

I have 3 line of code like this in my css.

-o-foo:foo;
-moz-foo:foo; 
-webkit-foo:foo; 

How is less going to help me ?

@leeoniya
Copy link

leeoniya commented Oct 4, 2011

try any mixin library...like http://markdotto.com/bootstrap/ or http://snipplr.com/view/54946/

or roll your own.

@jaseemabid
Copy link
Author

Is there a way to make a less variable a property itself and not just a propery value ?
Is this valid ?

.test (@prop) {
    @prop:red;
}
.test (color);  

Can we set text color red with this code ? If not, why cant we ?

@leeoniya
Copy link

leeoniya commented Oct 4, 2011

i'm not sure if it would work, (i hope not). i can't think of a specific use-case when this kind of flexibility would be necessary and wouldn't lead to needlessly confusing code.

can you provide an example of scenario where you envision using this?

@jaseemabid
Copy link
Author

-webkit-transform:rotate(-5deg); /* I hate this part :( Ugly browsers. */
-moz-transform:rotate(-5deg);
-o-transform:rotate(-5deg);

Is a usual code block seen in CSS files. Most of the advanced CSS is not implemented in a standard manner in browsers and needs 3 line of very similar code. Can we use less to improve this situation ?

@leeoniya
Copy link

leeoniya commented Oct 5, 2011

the second link i posted has a rotate mixin that lets you do

#whatever {
  .rotate(-5);
}

which will handle all browsers.

@lukeapage
Copy link
Member

duplicate of #36 (there is a pull request too)

stefanklug pushed a commit to stefanklug/carto that referenced this issue Jan 27, 2019
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

No branches or pull requests

3 participants