Will this support dynamic whole CSS property entries?
See original GitHub issueEx.
import { styled } from '@compiled/css-in-js';
const Foo = styled.div`
${(props) => (props.on ? 'color: red;' : 'color: black;')}
`
Today, this throws a
@parcel/transformer-babel: <css input>:3:3: Unknown word
CssSyntaxError: <css input>:3:3: Unknown word
I would provide a codesandbox but I’ve had a hard time getting @compiled running in any, is there a starter template in codesandbox? .
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Make Your CSS Dynamic with CSS Custom Properties - Toptal
Explore CSS custom properties and find out how they can be used to make better, more dynamic stylesheets.
Read more >CSS Custom Properties—Dynamic Changes With Javascript
One of the main advantages of CSS custom properties is the ability to change them in response to Javascript or user interaction.
Read more >Using CSS custom properties (variables) - MDN Web Docs
Each CSS property can be assigned a defined set of values. If you try to assign a value to a property that is...
Read more >Angular 2 - How to dynamically change an entire CSS ...
In short, we want 1 app that can be styled by a CSS file, based off a queryparam. All thoughts and comments will...
Read more >A Complete Guide to CSS Functions
There is only one function specific to CSS custom properties, but it makes the whole thing tick! The var() function is used to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@butlersrepos: Also check this link on compiled website: https://compiledcssinjs.com/docs/migrating#generating-css-at-runtime
Hi,
At the moment that CSS won’t be able to defined like that (so alternatively define it as just the value and it will work).
I have some ideas how we can enable this though (because it’s still static) but we have other priorities at the moment.
We should add a better error message for this case!
On Sun, 4 Oct 2020, 4:13 am butlersrepos, notifications@github.com wrote: