Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

před 3 roky
123456789101112131415161718192021222324252627282930313233
  1. # @emotion/stylis
  2. > A custom build of Stylis
  3. `@emotion/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.
  4. ```js
  5. type Options = {
  6. global: false,
  7. preserve: false,
  8. keyframe: false,
  9. semicolon: true,
  10. cascade: true,
  11. compress: false,
  12. prefix: boolean | ((key: string, value: string, context: number) => boolean)
  13. }
  14. ```
  15. ```jsx
  16. import Stylis from '@emotion/stylis'
  17. const stylis = new Stylis()
  18. stylis('.css-hash', 'display:flex;') // .css-hash{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}
  19. ```
  20. ## Building this package
  21. 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`.
  22. # Thanks
  23. Stylis was written by [Sultan Tarimo](https://github.com/thysultan). ❤️