Comments (1)
Well, first of all Stilr is the only solution out there that uses a content hash to generate the class name for your styles. Which means that we get duplicate style removal out of the box and it solves the namespace clashing that CSS often suffers from.
Besides that, Stilr tries to do one thing and do it well. It let's you create a bunch of styles and gives you a string of CSS when you render the stylesheet. What you do with that is up to you. Some prefer to mount it in the header before the app is rendered. Other outputs it to a css file in their build step.
In one of our production builds right now, we render our styles on the server, run them through an autoprefixer based on the clients header (e.g. if the user uses IE9, we only apply prefixes for that browser) and attach that to the serverside rendered React view.
Since Stilr only gives you a CSS string, it doesn't solve autoprefixing or attaching stuff to the document for you, like jss, j2c or smartCSS does, but honestly... There's no reason to. Attaching a stylesheet to the DOM is so simple. e.g.
let stylesheet = document.createElement('style');
stylesheet.textContent = StyleSheet.render();
document.head.appendChild(stylesheet);
And autoprefixing is solved by using postCSS's autoprefixer.
There's probably other differences, but I haven't used any of them enough to tell that.
from stilr.
Related Issues (20)
- Multiple values using arrays? HOT 4
- neccesary nesting? HOT 4
- Vendor prefixing? HOT 2
- Code in NPM isn't compiled HOT 2
- Allow style keys to be strings HOT 1
- Webpack plugin HOT 4
- Trouble importing Stilr via require() HOT 1
- What about debugging? HOT 7
- In hot-load mode, what if <App> doesn't re-render but a child of its does? HOT 4
- Allow prefix for tags
- Pretification HOT 1
- use babel 6 HOT 1
- Stilr & webpack - dynamic assets URLs HOT 1
- [email protected] doesn't satisfy peerDependencies on CI HOT 2
- Add eslint to CI
- v1.2.2 not working on internet explorer HOT 3
- j2c vs. stilr
- `content=""` is not rendered properly HOT 2
- Error: Cannot find module 'react/lib/CSSPropertyOperations' HOT 5
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 stilr.