Background color

Background color with proper text color (black or white);

Preview


#97D8C4
#7900FF

Module & Import


js

import { bgColor } from 'gadjet/dist/module/style/bg-color.js';

Function signature


bgColor(color: string = 'blue') => string;

param color: string = 'blue'

CSS color for background

return

CSS string

Usage


js

import { addStyle, bgColor } from 'gadjet';

addStyle`
div {
    ${bgColor('blue')}
}`;
gadjet
Getting Started Style Portion UI