styled-selector
Get static CSS(-in-JS) selectors (like .sc-htpNat
) from React components
Install
$ npm i styled-selector
Usage
Styled Components
;; const Comp = styleddiv``; ; // .sc-htpNat
Emotion
;; const Comp = ``; ; // .css-htpNat const className = css``; ; // .css-htpNat
Reuse
;;; const Comp = ; ; // .sc-htpNat
Custom
import React from "react";import s from "styled-selector"; const Comp = <div ="foo" />;Compselector = "#foo"; ; // #foo
License
MIT © Haz