From a8b047ee204291550f35cabab1f3202e923a62eb Mon Sep 17 00:00:00 2001 From: yutent Date: Tue, 19 Sep 2023 16:02:35 +0800 Subject: [PATCH] Add css --- css.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 css.md diff --git a/css.md b/css.md new file mode 100644 index 0000000..f4f5bbb --- /dev/null +++ b/css.md @@ -0,0 +1,21 @@ +## `css`函数 +> 这个函数, 内部做了兼容处理, 在支持`adoptedStyleSheets`的浏览器上自动使用`adoptedStyleSheets`, 否则转为使用style标签实现。 +>> 同时,配合VSCODE插件`string-html-css`, 可实现css语法高亮。 + +### 注意 +> 虽然配合vscode插件, 可以`scss`语汪高亮, 但是`css()`函数本身并不支持解析`scss`的。 +如果需要使用`scss`, 需要使用`wkit`的配套的构建工具来编译。 + + +```js + + + +class Foo extends Component { + + static styles = css` + .foo { color: red } + ` +} + +``` \ No newline at end of file