Comments (9)
The same problem exists for '&:hover', '&:before' and '&:after'.
Those all do work in jss in combination with theming.
from styled-jss.
Looks like a bug
from styled-jss.
Hi! Thank you for the issue, it looks like a bug with @media
and function rules
in jss
, described here: cssinjs/jss#706
from styled-jss.
Example snippet for @vbersch's issue:
this works:
const Link = styled('a')({
color: '#24292e',
'&:before': {
content: '"*"'
}
})
this doesn't:
const Link = styled('a')((props) => ({
color: '#24292e',
'&:before': {
content: '"*"'
}
}))
Both patterns are working fine in react-jss
from styled-jss.
I love this JSS plugin! Unfortunately we're experiencing the same issue. Our team has been able to work around it by providing an object which contains functions when the props/theme are needed, but I feel it would be more efficient if we could provide a function which returns a single object instead.
For example (modifying the above for illustration purposes), this works:
const Link = styled('a')({
color: ({ theme }) => theme.palette.primary.main
textDecoration: "none",
'&:hover': {
textDecoration: "underline"
}
})
But this does not:
const Link = styled('a')(({ theme }) => ({
color: theme.palette.primary.main
textDecoration: "none",
'&:hover': {
textDecoration: "underline"
}
}))
from styled-jss.
Still experiencing the bug with '&:hover'
as @MarcusNotheis described
from styled-jss.
We are currently working on porting this implementation to v10 of jss and also moving it into react-jss
in cssinjs/jss#1094
from styled-jss.
There will be no more work done in this repo. I will add a test case for this bug for the new styled API to see if it's fixed there.
from styled-jss.
@HenriBeck Ah okay. Amazingly quick response, thanks!
from styled-jss.
Related Issues (20)
- Overriding component style HOT 2
- Border property HOT 2
- Support Observables from JSS9
- What about keyframes animation? HOT 7
- Add plugins without re-exporting styled HOT 6
- react-jss and styled-jss in the same app HOT 3
- Remove isObservable checks
- SSR Support for styled-jss
- SSR Support HOT 1
- Bug: Nested composition causes invalid tag to be rendered HOT 1
- Support getting the ref of the wrapped component
- Add a way to filter props when extending other components
- Type Definitions HOT 1
- Mixing style objects and functions messes up specificity resolution HOT 1
- Composing function styles causes dynamic styles to not be used
- @global is not working HOT 4
- Component Name as the class name for easier debugging?
- How to install styled-jss when used in a library HOT 1
- Dynamic import styled-jss
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 styled-jss.