global
addon allows to inject global CSS. It introduces a :global
selector that can be
used in any CSS-like object and exposes global()
function for convenience.
Use :global
selector.
const className = nano.put('.foo', {
color: 'red',
'.nested': {
fontWeight: 'bold'
},
':global': {
'.global_class': {
border: '1px solid red'
}
}
});
This results in:
.foo {
color: red;
}
.foo .nested {
font-weight: bold;
}
.global_class {
border: 1px solid red;
}
Use global()
function to emit global CSS.
nano.global({
'.global_class': {
border: '1px solid red'
}
});
Simply install global
addon. Read more about the Addon Installation.