Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

css-constructor

> 前端框架
Open source

CSS constructor for React components

100 stars0 likes1 views
WebsiteGitHub

About

CSS constructor for React components

 

Every React component gets an inbuilt javascript constructor for functional logic.

Introducing the css constructor for styling!

   

…

--

Other features

Uses classes instead of inline styles

Editable in developer tools

Super tiny: only 1.2K gzipped!

Official library emoji

Coming soon

server side rendering

--

Usage

  1. npm install css-constructor --save

  2. import css from 'css-constructor'

  3. Add a @css block just before the render function (important)

  4. Add transform-decorators-legacy as the first plugin in your .babelrc (already downloaded with ).

If you are not familiar with babel plugins you can follow the detailed instructions here.

Or, if you would prefer using without adding the babel transform for decorators, up-vote this issue.

--

How does it work?

uses ES7 class method decorators on the render function. Detailed post coming soon.

Inspiration

Heavily inspired from glamor, styled-components and radium

Special thanks to thysultan. stylis is the bomb!

Support

⭐️ this repo!

Issues· 3 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptcss-in-jsdecoratorsreact

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架