Skip to content
This repository was archived by the owner on Dec 24, 2020. It is now read-only.

Support "conditional selectors" from Modernizr #172

Open
webxl opened this issue Mar 30, 2011 · 0 comments
Open

Support "conditional selectors" from Modernizr #172

webxl opened this issue Mar 30, 2011 · 0 comments

Comments

@webxl
Copy link

webxl commented Mar 30, 2011

I don't know if "conditional selectors" is the right term, but I'd there to be some way to have all my styles that apply to an element be in the same block/nest, and not have to write separate blocks/nests for conditional modernizr classes.

The issue is summed up nicely here:

http://icanhasweb.wordpress.com/2010/10/30/less-css/

"Although LESS is a joy to use, I do have some problems. For example, consider the code written when using modernizr (a JavaScript-library that enables feature detection of CSS3):

 .rounded_corners (@radius: 5px) {
   -moz-border-radius: @radius;
   -webkit-border-radius: @radius;
   border-radius: @radius;
 }

 #header {
   .button {
     /* CSS that all browsers supports */
    }
  }
 .borderradius #header .button {
   rounded_corners;
 }

This may seem but a slight irritation, but consider this example if #header parented style for 20+ sub-elements. Add the possibility that I wanted to use other CSS3-properties. I have no answer to how this should be solved, but my 2 cents would be the possibility to write code such as:

#header {
  .button {
    /* CSS that all browsers supports */
    [.borderradius] {
      rounded_corners;
    }
  }
}

This would equal the meaning in the former snippet, but its superior in elegance (at least in my view)."

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant