Comments (3)
I also want to use &
.
(&
represents the current selector parent sush a less or stylus )
css-in-js:
const st = cssInJS({
box: {
color: 'red',
width: 100,
height: 40,
'&:hover': {
color: 'blue',
'.hiddenBtn': {
opacity: 1
},
'& > .normalBtn': {
marginRight: 10
}
}
}
})
babel:
const st = {
box: 'dir_filename_js-styles-box',
hiddenBtn: 'dir_filename_js-styles-hiddenBtn',
normalBtn: 'dir_filename_js-styles-normalBtn'
}
css:
.dir_filename_js-styles-box {
color: red;
width: 100px;
height: 40px;
}
.dir_filename_js-styles-box:hover {
color: blue;
}
.dir_filename_js-styles-box:hover .dir_filename_js-styles-hiddenBtn {
opacity: 1;
}
.dir_filename_js-styles-box:hover > .dir_filename_js-styles-normalBtn {
marginRight: 10px;
}
from babel-plugin-css-in-js.
Hi Alfred, sorry for the delay.
Could I make some PR?
Sure! Happy to merge any of the improvements you're talking about. Thanks!
from babel-plugin-css-in-js.
I'll try it if I have some time.
Please let me know if anyone has any idea or feedback on this issue.
from babel-plugin-css-in-js.
Related Issues (18)
- unknown node of type "NumberLiteral" with constructor "Node" when using numbers for values HOT 2
- context would be nice to take in an entry point file to be require'd HOT 2
- Usage in a webpack dev environment HOT 5
- nth-of-type example HOT 5
- Single letter class names cause an error HOT 1
- Not Getting Expressions To Work AssertionError HOT 1
- Dynamic style objects HOT 1
- String value cannot be blank HOT 2
- CSS specificity HOT 17
- Is there any solution about universal app? HOT 2
- Support specific platform or theme? HOT 8
- How are you preventing caching on bundle.css ? HOT 3
- Support global style rules HOT 2
- Should not split media query blocks
- feature request: support template literal HOT 4
- Is there any support for sub-selectors currently? HOT 9
- nested selector HOT 4
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 babel-plugin-css-in-js.