0.2.0 • Published 3 months ago

powerstyl v0.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

powerstly

Style with template strings.

npm i powerstyl

Convert a CSS string to an object.

import { css } from "powersty";
<ReactElement
  style={css`
    // CSS text
  `}
/>;

Apply a style to a react element.

import powerstyl from "powersty";

const FlexContainer = powerstyl`main``
  display:flex;
`;

<FlexContainer>...</FlexContainer>;

/* 
<main style="display:flex">
  ...
</main>
 */
import { styled, inlined } from "powersty";

styled accepts an element name and its CSS.

const Red = styled`
  color: red; 
`;

<Red>text</Red>;

/* 
  <div style="color:red;">text</div>
 */

inlined applies a style to the child element.

const Green = inlined`
  color: green; 
`;

<Green>
  <div>text</div>
</Green>;

/* 
  <div style="color:green;">text</div>
 */

With CSS preprocessors (sync).

import less from "powersty/less";
import sass from "powersty/sass";

const lessStyle = less`
// ... less code
`;
const sassStyle = sass`
// ... sass code
`;

With options.

const lessStyle = less(options)`
// ... less code
`;
const sassStyle = sass(options)`
// ... sass code
`;
0.2.0

3 months ago

0.1.2

3 months ago

0.1.0

7 months ago

0.1.1

7 months ago

0.0.6

7 months ago

0.0.5

10 months ago

0.0.4

11 months ago

0.0.3

11 months ago

0.0.2

11 months ago

0.0.1

11 months ago