Comments (5)
Any variable would cause this issue because it didn't appear to get interpolated when it was consumed by toJSS(). A console.log(css) in there show this.
If the string is encapsulated in brackets, it all works great.
const runningColor = 'green';
const lss = RNC(`
bla {
background-color: ${runningColor};
}
`);
return <View style={lss.bla}></View>
Tagged template literals behave different with or without parentesis:
Chrome:
const test = 'literals';
console.log`hello template ${test}`
>["hello template ", "", raw: Array(2)]
"literals"
console.log(`hello template ${test}`)
>hello template literals
I don't have enough time to keep digging (and I can live with brackets), but maybe above info will make it obvious for you ^
from react-native-css.
Hi,
Just for information, in the "react-native-css": "^2.1.2"
works normally!
from react-native-css.
Thank you, I will investigate.
from react-native-css.
Does this only happen when using ${runningColor};
?
from react-native-css.
@anzorb thank you so much for doing all the digging. Please test [email protected]
.
Add the following test:https://github.com/sabeurthabti/react-native-css/blob/a7ad812fbb346daae052b337467d71e1e3d46fee/test/rnc.test.js#L240
should be working as expected.
from react-native-css.
Related Issues (20)
- Can i write LESS like CSS just like that in webpages with this tool? HOT 2
- Doesn't work with Windows OS HOT 1
- value auto is set like null HOT 3
- Can't generate shadowOffset HOT 4
- Shorthands aren't properly expanding HOT 1
- Update purpose and scope HOT 1
- Add validation
- Interest in Integrating? HOT 5
- Convert properties that don't match their CSS equivalent HOT 5
- Compatibility with other css preprocessors - Stylus HOT 1
- nesting styles HOT 9
- Ability to use predefined features from StyleSheet object.
- shadowOpacity
- No Longer under active development.
- [enhancement] Create gulp plugin HOT 2
- Version 2
- V2: package.json points to incorrect main HOT 10
- undefined is not a function (Symbol.iterator) HOT 2
- Little hack for code complete to who use VSCode! [suggestion] HOT 1
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 react-native-css.