1.1.5 • Published 8 months ago

@moneko/css v1.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
8 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

8 months ago

1.1.4

8 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.5

1 year ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago