Colorable enforces consistent use of color across components.
import { DaffColorableDirective } from '@daffodil/design'
Enforces consistent use of DaffColor on a component by applying
color-specific CSS classes and validating the color in dev mode.
@Directive()
class DaffColorableDirective implements OnChanges, OnInit {
defaultColor: DaffColor
@Input() color: DaffColor
}
DaffColor| Default | – |
|---|---|
| Description | The color of the component. |
DaffColor| Default | – |
|---|---|
| Description | The default color used when no color is set. |
import { DaffPalette } from '@daffodil/design'
type DaffPalette = DaffColor
import { DaffColor } from '@daffodil/design'
The available color options.
type DaffColor = 'primary' | 'secondary' | 'tertiary' | 'light' | 'dark' | 'theme' | 'theme-contrast' | 'black' | 'white' | undefined
import { DaffColorable } from '@daffodil/design'
interface DaffColorable {
color: DaffColor
}