Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Polished | 7,509 | 5,644 | 4,583 | 2 months ago | 93 | April 06, 2022 | 26 | mit | JavaScript | |
A lightweight toolset for writing styles in JavaScript ✨ | ||||||||||
Steroidesign | 781 | 6 years ago | n,ull | HTML | ||||||
Themes based on the biggest StartUps (buttons, color palette, components, etc.) ready to use in your own projects. | ||||||||||
Naomi | 555 | a year ago | 97 | other | MQL4 | |||||
Sublime Text enhanced syntax highlighting for JavaScript ES6/ES7/ES2015/ES2016/ES2017+, Babel, FlowType, React JSX, Styled Components, HTML5, SCSS3, PHP 7, phpDoc, PHPUnit, MQL4. Basic: Git config files. | ||||||||||
React Bolt | 317 | 10 months ago | 22 | JavaScript | ||||||
⚡ The most simple & robust boilerplate for your React projects. | ||||||||||
Styled Components Theme | 299 | 24 | 10 | 4 years ago | 9 | July 11, 2017 | 7 | mit | JavaScript | |
Defines themes via flexible color selectors for use with styled-components | ||||||||||
Prejss | 244 | 3 | 6 years ago | 11 | March 30, 2017 | 12 | mit | JavaScript | ||
Get the power of PostCSS with plugins in your JSS styles. 🎨 Just put CSS into JS and get it as JSS object. | ||||||||||
Interfaces Clone | 126 | 2 years ago | n,ull | CSS | ||||||
Repositório com clones de interfaces para praticar CSS | ||||||||||
Frontend Starter Kit | 122 | 7 months ago | 6 | mit | TypeScript | |||||
The building blocks of front-end development at Springload | ||||||||||
Sass Extract Js | 96 | 31 | 21 | 5 years ago | 4 | July 23, 2018 | 2 | mit | JavaScript | |
Plugin for sass-extract to convert Sass variables into a plain JS object | ||||||||||
Styled | 57 | 10 months ago | other | TypeScript | ||||||
Minimal CSS-in-JS styled components solution for React. |
A lightweight toolset for writing styles in JavaScript.
npm install --save polished
# or if you're using yarn
yarn add polished
Want to write styles in JavaScript, but also want Sass-style helper functions and mixins? Need a consistent color palette throughout your app? polished
is for you!
styled-components
, emotion, jss, aphrodite, radium, or plain inline styles, as long as you're writing your styles in JavaScript you can use polished!See the full documentation at polished.js.org!
polished
modules are meant to be used as stand-alone imports. You should avoid importing the entire library directly:
import { clearFix, animation } from 'polished'
import * as polished from 'polished
import polished from 'polished'
When polished
modules are imported properly, tree shaking in webpack and Rollup can be leveraged to reduce your bundle size.
All Evergreen Browsers + IE11
As of v3.6.X we support >0.5%, not dead, ie >= 11, not op_mini all
for all our builds.
polished
has first-class Flow support with zero configuration to assist you in finding type errors while using our modules.
Flow frequently updates and it is possible that the version you are running may cause you to run into errors coming from the polished
package in your node_modules
directory. You can add the following lines to your .flowconfig
to ignore polished
in those cases:
[ignore]
.*/node_modules/polished/.*
polished
has TypeScript definitions to allow the library to be used in any TypeScript project. You will need to set moduleResolution
to node
in your tsconfig.json
in order to use polished
with TypeScript.
You can optionally also use babel-plugin-polished
to compile the static function calls out and remove the (already tiny) runtime performance impact of using polished
.
In the documentation you will see examples using object spread properties ({ ...other }
). To enable this syntax in your project add the transform-object-rest-spread
plugin (or the stage-3
preset to enable all stage three features) to your Babel configuration.
When writing styles in JavaScript, many people need Sass-style helper functions to be productive. polished
brings them to you in a nice, lightweight package tailor-made for styles in JavaScript.
The main difference with Sass is that it's written in a functional style and all color functions are curried. This means you can compose them together into your own reusable helpers with a compose
function of your choice:
import { compose } from 'ramda' // Replace with any compose() function of your choice
import { lighten, desaturate } from 'polished'
// Create tone() helper
const tone = compose(lighten(0.1), desaturate(0.1))
package-xyz
?First of all, we didn't find another library that had everything we needed, and we don't care about installing a dozen packages separately.
Specifically most other packages that provide color functions do so in an object-oriented style, often with a fluent API that's very different from the Sass-style helpers. This means people that aren't very familiar with JavaScript might shy away from using them.
polished
was made as a standard library for everybody, no matter if they know JS inside out or not.
polished is compatible with any library that accepts styles as JS objects. This includes, but is by far not limited to, styled-components
, radium, aphrodite, glamor, glamorous, jss and many more!
No matter if you're using inline styles or CSS-in-JS, polished is for you.
This project exists thanks to all the people who contribute. [Contribute].
Thank you to all our backers! [Become a backer]
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]
Copyright 2016-2021 Brian Hough, Maximilian Stoiber, & Nik Graf. Licensed under the MIT License, see LICENSE.md for more information!