1.1.5 • Published 6 months ago

@moneko/css v1.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

css

css in js

基于 emotionstylis 的 css in js

yarn add @moneko/css -S

在 web component 中使用

import { css } from '@moneko/css';

const style = css`
  :host {
    --color: red;
  }
  p {
    color: var(--color, red);
    
    & span {
        color: green;
    }
  }
`;

function Comp() {
  return (
    <>
      <style>{style}</style>
      <p>aaa</p>
      <slot />
    </>
  );
}

插入全局样式

import { injectGlobal } from '@moneko/css';

// 执行这段代码将样式插入到head中,返回一个消除函数
const flush = injectGlobal`
    body {
        color: red;
    }
`;

// 消除刚才插入的全局样式
flush();
1.1.5

6 months ago

1.1.4

7 months ago

1.1.3

7 months ago

1.1.2

8 months ago

1.1.1

10 months ago

1.1.0

10 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago