stackcss / postcss-prefix Goto Github PK
View Code? Open in Web Editor NEWPrefix CSS selectors
License: Other
Prefix CSS selectors
License: Other
I think it would help ensure the tests aren't failing. Note that tests are failing in the latest release on node 5 (#12)!
I can't the license information of this package, providing it would be better.
trying to use the :nth-child
pseudo-selector and its not working as expected:
.row {
border: 1px solid black;
}
.row:nth-child(odd) {
background-color: #eee;
}
<div>
<div class="row">yo!</div>
<div class="row">dude</div>
</div>
However, when you do this with sheetify, the transformed CSS looks like:
._ffdf2d5a .row {
border: 1px solid black;
}
._ffdf2d5a .row:nth-child(._ffdf2d5a odd) {
background-color: #eee;
}
Which does not apply the rule to the odd nth-children. If you add a rule in your inspector omitting the ._ffdf2d5a
prior to odd
:
._ffdf2d5a .row:nth-child(odd) {
background-color: #eee;
}
It works as expected.
I don't think there's much trick to this, besides making sure we can properly parse an animation:
declaration. Hopefully our current AST implementation already does that for us.
from stackcss/sheetify#22 (comment),
/* This: */
:host { color: green; }
:host(:hover) { color: blue; }
/* Becomes: */
.prefix { color: green; }
.prefix:hover { color: blue; }
$ nvm version
v5.12.0
> [email protected] test /Users/cjhowe7/Desktop/postcss-prefix
> tape test/index.js
TAP version 13
# postcss-prefix
/Users/cjhowe7/Desktop/postcss-prefix/node_modules/postcss/lib/lazy-result.js:277
throw error;
^
SyntaxError: Identifier 'prefixNode' has already been declared
at /Users/cjhowe7/Desktop/postcss-prefix/index.js:19:35
at /Users/cjhowe7/Desktop/postcss-prefix/node_modules/postcss-selector-parser/dist/selectors/container.js:164:26
at Root.each (/Users/cjhowe7/Desktop/postcss-prefix/node_modules/postcss-selector-parser/dist/selectors/container.js:147:22)
at Root.eachInside (/Users/cjhowe7/Desktop/postcss-prefix/node_modules/postcss-selector-parser/dist/selectors/container.js:163:21)
at Processor.transformSelectors [as func] (/Users/cjhowe7/Desktop/postcss-prefix/index.js:19:15)
at Processor.process (/Users/cjhowe7/Desktop/postcss-prefix/node_modules/postcss-selector-parser/dist/processor.js:31:14)
at /Users/cjhowe7/Desktop/postcss-prefix/index.js:12:10
at /Users/cjhowe7/Desktop/postcss-prefix/node_modules/postcss/lib/container.js:241:28
at /Users/cjhowe7/Desktop/postcss-prefix/node_modules/postcss/lib/container.js:148:26
at Root.each (/Users/cjhowe7/Desktop/postcss-prefix/node_modules/postcss/lib/container.js:114:22)
npm ERR! Test failed. See above for more details.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.