Comments (5)
Does the spec allow that ? If so please make a PR :)
from postcss-custom-selectors.
It's not mentioned in the spec. That said, the @custom-selector
grammar accepts a <selector>
and allows the provided <custom-selector>
to be used as a <selector>
even though the grammar doesn't include it yet. It seems reasonable then to say that the <selector>
in the @custom-selector
grammar should accept any <custom-selector>
as well.
I'm happy to put together a pull request if this sounds reasonable enough.
from postcss-custom-selectors.
We can ask @tabatkins for that since he is the author of the spec ;)
from postcss-custom-selectors.
Good call.
from postcss-custom-selectors.
Note that custom selectors are pseudo-classes, so it would be :--heading
, etc.
But yeah, you can totes use custom pseudo-classes in the definitions of other custom pseudo-classes. You need to run a cycle detector, though, and mark all of the ones that are involved in the cycle as invalid (the rules themselves are valid, but they define a pseudo-class that matches nothing). This hasn't been put into the spec yet, but it matches what custom properties do.
from postcss-custom-selectors.
Related Issues (20)
- Keep original code when a selector is undefined + add a warning HOT 2
- "more complicated things" HOT 3
- Use PostCSS 4.1 API HOT 2
- Two or more consecutive hyphens in selector outputs "undefined" HOT 1
- Wrong output when mixing selectors HOT 10
- Use the postcss-selector-matches HOT 5
- lineBreak does not respect indentation HOT 7
- Using multiple custom-selectors in one selector does not work HOT 14
- When customSelectors is empty, console gets polluted HOT 2
- Warning: "The selector X is undefined" HOT 5
- Not valid output HOT 5
- Incompatible with :matches() HOT 1
- custom selectors with nesting HOT 3
- `npm test` crashes
- custom selectors are not applied when used in combination with postcss-nesting HOT 2
- Incorrect indentation and spaces HOT 1
- Iterate over each item in a selector? HOT 1
- Invalid spacing applied to custom-selector lists HOT 2
- Support `.pcss` file extension HOT 1
- usage with a class name selector that contains a double hyphens output a undefined selector HOT 3
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 postcss-custom-selectors.