gadjet provide useful style portion which can be used with HTML elements and
can be injected to HTML page by tag template addStyle
.
import { addStyle, bgColorInt } from 'gadjet/dist/bundle/gadjet.js';
// Add interactive background color to <button> element
addStyle`
button {
${bgColorInt('blue')}
}`;
gadjet implement CSS-in-JS by using feature from
@emotion/css
. If you look into the source code, you will see thataddStyle
is just a function that point toinjectGlobal
from @emotion/css.