https://github.com/dash-ui/stylis
A fork of @emotion/stylis that makes it even smaller, still, though maybe obsolete with Stylis v4's release :)
https://github.com/dash-ui/stylis
css-in-js css-in-ts dash dash-ui stylis
Last synced: about 2 months ago
JSON representation
A fork of @emotion/stylis that makes it even smaller, still, though maybe obsolete with Stylis v4's release :)
- Host: GitHub
- URL: https://github.com/dash-ui/stylis
- Owner: dash-ui
- License: mit
- Created: 2020-05-14T21:37:21.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2023-10-17T09:31:16.000Z (over 2 years ago)
- Last Synced: 2025-10-13T14:58:46.925Z (8 months ago)
- Topics: css-in-js, css-in-ts, dash, dash-ui, stylis
- Language: JavaScript
- Homepage:
- Size: 1.45 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README

> A fork of @emotion/stylis that makes it even smaller, still
```sh
npm i @dash-ui/stylis
```
---
`@dash-ui/stylis` is a version of [Stylis](https://github.com/thysultan/stylis.js) that has been modified slightly to make it smaller. The only Stylis option that can be changed is `prefix`, the rest of the options are already set to the values shown below and cannot be changed. This package also only exports the constructer, so you have to do `new Stylis()` and use the result from that rather than directly calling `Stylis`. The result of that function also cannot be used to create a stylis instance unlike stylis.
```js
type Options = {
global: false,
preserve: false,
keyframe: false,
semicolon: true,
cascade: true,
compress: false,
prefix: boolean | ((key: string, value: string, context: number) => boolean),
};
```
```jsx
import Stylis from "@dash-ui/stylis";
const stylis = new Stylis();
stylis(".css-hash", "display:flex;"); // .css-hash{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}
```
## Building this package
To build this package from a newer version of stylis, update the version of stylis that is installed as a devDependency and run `node build.js` in the directory of this package. This will read the source of stylis, transform it slightly, use the [Google Closure Compiler REST API](https://developers.google.com/closure/compiler/docs/gettingstarted_api) to minify it, format it with Prettier and then write it to `src/stylis.min.js`.
# Thanks
- The [emotion](https://github.com/emotion-js) team did most of the work on this one, I just did some extra minifying ❤️
- Stylis was written by [Sultan Tarimo](https://github.com/thysultan). ❤️
## LICENSE
MIT