W3C home > Mailing lists > Public > public-css-archive@w3.org > February 2017

[csswg-drafts] CSS Regex Selector

From: programmer5000.com via GitHub <sysbot+gh@w3.org>
Date: Tue, 07 Feb 2017 16:22:23 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-205940001-1486484541-sysbot+gh@w3.org>
programmer5000-com has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== CSS Regex Selector ==
This would resolve #1008.
It would be very nice to have the ability to do a regex selector on a 
tag, like this:
```CSS
/**Match all h1-h6 tags**/
/^h\d$/i{
     font-family: "Roboto", sans-serif;
}
/**Match all ruby elements**/
/^r[a-z]+/i{
     font-weight: bold;
}
```
and so on. Better yet, allow regex to be used in classes, etc.
```CSS
/**Match sections with ids of card-1, card-2, etc.**/
section#/card-\d+/i{
     padding: 10px;
     border-radius: 10px;
     background: white;
}
```
This would be an extremely helpful feature of CSS that would help 
developers write lean, beautiful code and I would love to see it added
 to the spec!

Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/1010 using your GitHub 
account
Received on Tuesday, 7 February 2017 16:22:42 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:30:28 UTC