Giter Site home page Giter Site logo

michelebertoli / css-in-js Goto Github PK

View Code? Open in Web Editor NEW
5.5K 108.0 290.0 582 KB

React: CSS in JS techniques comparison

Home Page: http://michelebertoli.github.io/css-in-js/

License: MIT License

JavaScript 77.53% HTML 16.94% CSS 5.35% Makefile 0.18%
cssinjs css-in-js

css-in-js's Introduction

Build Status

CSS in JS

React: CSS in JS techniques comparison.

Usage

Inside each package folder, run:

npm i
npm run build && open index.html

Features

How to read the table

More ticks doesn't mean "better", it depends on your needs. For example, if a package supports the css file extraction you can run the autoprefixing at build time.

Package Version Automatic Vendor Prefixing Pseudo Classes Media Queries Styles As Object Literals Extract CSS File Package Stats
aphrodite
tag 2.2.2 star 4,175
1.2.3
info 63/133
download 358,386
babel-plugin-css-in-js
tag 1.5.1 star 259
1.2.2
info 6/12
download 408
babel-plugin-pre-style
tag 1.5.1 star 259
1.0.9-alpha
info 6/12
download 408
bloody-react-styled
tag 0.0.5 star 35
3.0.0
info 1/2
download 12
classy
tag 1.4.10 star 22
0.3.0
info 0/0
download 88
csjs
tag 1.1.0 star 516
1.0.0
info 22/25
download 1,827
css-constructor
tag 0.1.7 star 90
0.1.1
info 4/2
download 65
css-light
tag 1.1.0 star 2
1.1.0
info 1/0
download 54
css-loader
tag 0.28.11 star 2,770
0.15.6
info 59/496
download 7,442,704
css-ns
tag 1.2.1 star 107
1.0.0
info 1/1
download 313
cssobj
tag 1.3.6 star 221
0.2.21
info 2/12
download 205
cssx
tag 5.2.1 star 998
3.8.0
info 10/14
download 314
cxs
tag 6.2.0 star 896
6.2.0
info 18/20
download 2,940
electron-css
tag 0.6.0 star 2
0.6.0
info 0/0
download 135
emotion
tag 9.2.4 star 4,101
6.0.3
info 73/306
download 260,249
es-css-modules
tag 1.2.4 star 151
1.2.3
info 1/2
download 116
freestyler
tag 3.1.0 star 121
1.5.0
info 12/0
download 212
glamor
tag 2.20.40 star 3,196
2.1.0
info 79/206
download 842,621
glamorous
tag 4.13.1 star 3,607
4.12.5
info 1/183
download 795,853
hyperstyles
tag 3.3.1 star 52
3.3.0
info 0/3
download 51
i-css
tag 1.2.0 star 2
1.0.4
info 0/0
download 52
j2c
tag 0.11.3 star 155
0.10.0
info 8/24
download 613
jsxstyle
tag 2.1.3 star 1,804
2.1.1
info 12/75
download 3,174
linaria
tag 0.5.0 star 351
0.5.0
info 21/62
download 349
nano-css
tag 2.0.2 star 51
0.1.0
info 15/3
download 682
pre-style
tag 1.0.9-alpha star 30
1.0.9-alpha
info 4/3
download 16
radium
tag 0.24.0 star 6,372
0.13.5
info 84/475
download 857,067
react-css-builder
tag 0.2.0 star 20
0.2.0
info 0/0
download 5
react-css-components
tag 1.0.1 star 701
0.6.9
info 5/9
download 40
react-css-modules
tag 4.7.3 star 4,641
3.0.2
info 47/152
download 172,299
react-cssom
tag 1.0.0 star 54
1.0.0
info 0/0
download 5
react-fela
tag 6.1.8 star 1,402
2.1.0
info 18/274
download 24,191
react-free-style
tag 7.0.2 star 119
0.6.0
info 0/19
download 154
react-inline-css
tag 2.3.1 star 165
1.2.0
info 6/12
download 10,718
react-inline-style
tag 0.1.0 star 45
0.1.0
info 1/0
download 4
react-inline
tag 0.8.2 star 452
0.6.3
info 3/0
download 121
react-jss
tag 8.6.0 star 928
2.0.5
info 17/180
download 431,995
react-look
tag 1.0.1 star 598
0.6.1
info 14/0
download 77
react-native-web
tag 0.8.6 star 9,653
0.0.11
info 21/739
download 51,794
react-statics-styles
tag 3.1.0 star 25
3.0.2
info 0/0
download 12
react-styl
tag 0.0.3 star 42
0.0.1
info 0/0
download 62
react-style
tag 0.5.5 star 1,687
0.5.5
info 34/65
download 1,500
react-styleable
tag 3.3.0 star 197
1.4.0
info 1/5
download 1,087
react-stylematic
tag 1.1.0 star 19
1.0.1
info 1/0
download 1,957
react-theme
tag 0.1.4 star 65
0.1.4
info 0/0
download 483
react-vstyle
tag 0.1.0 star 19
0.1.0
info 0/0
download 6
reactcss
tag 1.2.3 star 1,498
0.3.2
info 4/43
download 545,864
restyles
tag 2.0.1 star 47
2.0.1
info 1/1
download 17
scope-styles
tag 0.6.0 star 23
0.6.0
info 7/6
download 1,354
smart-css
tag 1.1.1 star 73
1.1.1
info 4/3
download 12
stile
tag 3.1.0 star 19
___________________________
react-media-queries
tag 2.0.1 star 65
2.0.0
info 1/3
download 21
____________
info 1/2
download 22
stilr
tag 1.3.0 star 236
1.1.0
info 5/18
download 148
stylable
tag 5.4.9 star 728
5.0.2
info 62/114
download 9,275
style-it
tag 2.0.0 star 92
1.2.9
info 1/25
download 2,686
styled-components
tag 3.3.3 star 17,306
3.2.6
info 104/1092
download 1,085,338
styled-jsx
tag 2.2.7 star 3,275
0.0.7
info 21/284
download 186,617
styletron-react
tag 3.0.4 star 2,485
2.1.2
info 59/82
download 5,709
styling
tag 0.4.1 star 130
0.2.0
info 5/2
download 49
superstyle
tag 1.0.0-1 star 31
1.0.0-1
info 0/1
download 5
@thi.ng/hiccup-css
tag 0.2.3 star 170
0.2.0
info 5/14
download 537
typestyle
tag 2.0.1 star 1,919
0.22.3
info 15/151
download 23,530
uranium
tag 0.1.0 star 117
0.1.2
info 3/6
download 6

This list has been auto-updated (?) on August 8, 2018

Testimonials

"Wow, this totally makes my week!" - Dan Abramov

"nice compilation of css-in-js techniques" - TJ Holowaychuk

SurviveJS / Styling React by Juho Vepsäläinen

The Case for CSS Modules by Mark Dalgleish

First Class Styles by Mark Dalgleish

Styling React.JS applications by Max Stoiber

Contributing

If your package is not listed here, feel free to add it.

  1. Create a new folder named package-name in the root folder.
  2. Implement the red button example using the package.
  3. Add a new entry to data.json.
  4. Rename ReadmeSrc/.env_example to ReadmeSrc/.env and set a Github access token to retrieve data from Github.
  5. Re-generate the data with: cd ReadmeSrc && yarn && yarn update-data && yarn generate-readme.

css-in-js's People

Contributors

albinotonnina avatar azazdeaz avatar azukaar avatar blade254353074 avatar bloodyowl avatar chenxsan avatar futurist avatar grigio avatar hozefaj avatar jacobp100 avatar kof avatar kwelch avatar martinandert avatar michelebertoli avatar necolas avatar notatestuser avatar ph101pp avatar postrad avatar pygy avatar readmecritic avatar rickwong avatar roman-orlovskiy avatar rtsao avatar satya164 avatar siddharthkp avatar stereobooster avatar streamich avatar threepointone avatar ybiquitous avatar zamotany avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

css-in-js's Issues

"Extract CSS File" seems misleading

First of all, thank you so much for your work in compiling this table! It's an awesome reference.

Now, my question: How do you determine whether a library supports CSS file extraction (under the "Extract CSS File" column)? As an example, aphrodite has a checkmark under that column, but this issue suggests that this is explicitly not a feature of the library. Other libraries that have that checkmark in the table, such as glamorous, don't suggest any way of accomplishing this.

Either I'm misunderstanding what that column means, in which case it might be a good idea to describe it in the readme, or some of these values are incorrect. If it's the latter, I would be more than happy to go through them and compile a list of which of these libraries actually advertise this as a feature.

Thanks!

Thank you for doing this.

Appreciate you having done a lot of research into the latest wiz-bang frameworks. This is super useful.

Rename Autoprefixer Included

Most of projects doesn't contain Autoprefixer itself, but v use some other tool.

Maybe we should write column name more clear, like "Vendor Prefixes"?

Abandoned libraries

The following libraries that are in your list appear to have been abandoned by their authors. I don't know if you'd prefer to remove them from the repo (I can make a PR if you'd like) or if you want to keep them listed for historic value.

  • react-inline - The repo has been archived by its owner.
  • react-look - The repo has been archived by its owner and an explicit "deprecated" message has been added in its README and its description on Github suggesting people use Fela and react-fela (already listed in this project) instead.
  • react-style - The author has added messages to the README file and the Github repo description warning that the code is "UNMAINTAINED".

Column request: Uses CSS syntax

At least some of the listed libraries use CSS syntax, rather than or as well as object literals (styled-components, styled-jsx, etc.), some only permit objects. It would be nice if this was also part of the table, since that is a significant factor for those who for example have to port existing CSS, or use third-party components that do not style themselves.

`last update` column in css-in-js table

Currently, projects are sorted alphabetically.
It would be really nice to instead have them sorted by last update

Maybe there are services/bots that could be set to update that table on major or maybe even minor version updates... not sure... but i'm coming back to css-in-js in irregular intervals to check if there is a new cool project :-)

Maybe there are already easy ways to figure out what to check, but i don't find it trivial to see what changed.

Add React Styleable

This one seems is interesting, as it let's you write styles externally in CSS/SASS but you get the CSS classNames as strictly-interfaced props via a Higher-Order Component. This means that changing used styles externally by mistake, will trigger "undefined" errors when using them in React.

Take a look: https://github.com/pluralsight/react-styleable

I would like to include some more features

  • @Keyframes support
  • @font-face support
  • extensibility/plugins api
  • fallbacks
  • framework agnostic (not just react)
  • rendering technics:
    • generates CSS and inserts style element
    • uses inline styles
    • mixed mode: inline styles, CSS, reacts event system for :hover and co (radium)

Also I would add below a description for each feature.

Format numbers in README

We recently added more data to the README, such as GitHub stars and monthly downloads for each package.
However, we are not formatting the numbers and this makes the information hard to read.

untitled 2

This is for first-contributors only - feel free to ping me if you need help.

Request for adding stars in the data sheet

Feature request

This is a great effort, more like a booklet of awesome frameworks.

I was trying add the GitHub stars per project in the last column, but for some reason I wasn't able to do it. Most badges require some JS script to be embedded, I even tried the shields.io badges, but wasn't successful.

If this is in your charter, may I help putting this together? Unless we head to github pages, or a separate website, anyway doing this?

Thanks.

Use NPM Badge for version

Would it be possible to use the NPM badge for version? This would ensure version reported is latest and also provide another link to documentation.

Roadmap

(personal vision)

Everybody would agree that MicheleBertoli's comparison table is the widest (number of libraries being compared), but not the deepest (number of features being compared). I want to fix this.

First stage

The first stage is to implement a website for comparison table because it is hard to show and maintain a big number of features in markdown table.

So I did a basic website, which presents the same data as current readme. But as of now

  • it lives in a separate branch,
  • information is duplicated in JSON file and Readme
  • is hosted with the help of GH pages
  • and deployment process is manual

Obviously, we need to automate website deployment. We can use CI to push updates or something like Netlify.

  1. #76 Any preferences or suggestions?

Information should not be duplicated in JSON file and Readme.

  1. #79 We can generate Readme from JSON or remove the table from Readme and use website table only.

I have this idea that every feature should be proved with code example, so every change in the table will be accompanied by PR to master branch. Hence the question:

  1. #78 should we move the website to master branch or at least JSON-file? So we can have one PR instead of two?

Second stage

It is important to define features precisely. I tried to do this here. CSS-in-JS is so new and fast-moving field, so it is hard to track everything and unprecise definitions make life harder. For example, Radium supports :hover, but this is not actual CSS pseudo class, but faked with JS listeners, so it will not work with disabled JS (no progressive enhancement). Disclaimer: I haven't checked what it does right now, maybe this changed.

As soon as we come up with proper definitions, we will need to come up with a code example for at least one library to show how it suppose to work. After this we can add a new feature to the table and mark our one new example as "positive" (or green color) every other library in the table will get "unknown" state (or gray color) until somebody will provide "code proof" of "positive" or "negative" result. Example of icons: #80

Improvements

  1. We can make life a bit easier by implementing screenshot testing, to make sure every example looks the same.

  2. We can implement benchmarks. Examples: 1, 2, 3, 4

  3. Calculate footprint of CSS-in-JS solution with something, like size-limit

Other comparison tables

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.