[IMP] tags: reintroduce inline css tag

The CSS tag is useful to define a css stylesheet in the javascript file:
```js
class MyComponent extends Component {
  static template = xml`
        <div class="my-component">some template</div>
    `;
  static style = css`
    .my-component {
      color: red;
    }
  `;
}
```

The `css` tag registers internally the css information. Then, whenever the first instance of the component is created, will add a <style> tag to the document <head>.

Original commit in Owl v1: 953778dc5
This commit is contained in:
Bruno Boi
2021-11-03 10:00:15 +01:00
committed by Aaron Bohy
parent d3745e4e5f
commit 348b505e5f
6 changed files with 266 additions and 143 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ export function useComponent(): Component {
export { status } from "./component/status";
export { Portal } from "./misc/portal";
export { Memo } from "./misc/memo";
export { xml } from "./tags";
export { css, xml } from "./tags";
export { useState } from "./reactivity";
export { useRef } from "./refs";
export { EventBus } from "./event_bus";