Git Product home page Git Product logo

Comments (1)

chriskjaer avatar chriskjaer commented on August 31, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.