0.1.5 • Published 5 years ago
@impromptu/css v0.1.5
@impromptu/css
Tiny CSS-in-JS utilities.
Getting Started
import { stylesheet } from "@impromptu/css";
stylesheet({
body: {
padding: 0,
},
});API
Utilities
getId(prefix?)- Returns a unique identifier.
- This function will work even if multiple versions of this library are in use.
getClassName(...classNames)- Alias:
cx(...classNames) - Returns a normalized class name string.
- If a falsy value is given, it will be omitted.
- If a map of class names is given, only those with a value of
truewill be included.
- Alias:
getStyleText(style, namespaceSelector?)- Returns stylesheet text suitable for assignment to
HTMLStyleElement.textContent.
- Returns stylesheet text suitable for assignment to
stylesheet(...style)- Appends a global stylesheet to document head.
- Returns the appended
<style>element.
Constants
Em- A constant value of
16, which is the suggested width in pixels of1em. AllResponsiveWidthvalues are a multiple of this constant.
- A constant value of
ResponsiveWidth- Standard responsive min-width break points in pixels.
0.1.5
5 years ago