UNPKG

@aegisjsproject/styles

Version:

Pre-made and reusable styles for `@aegisjsproject/core`

20 lines (16 loc) 802 B
import { css } from '@aegisjsproject/parsers/css.js'; import { customProperties } from './consts.js'; export const properties = css`${Object.entries(customProperties).map( ([name, { initialValue, inherits = true, syntax = '*' }]) => `@property --aegis-${name} { syntax: "${syntax}"; inherits: ${inherits}; initial-value: ${initialValue}; }` ).join('\n\n')}`; // Only needed when using a bundled component - Prefer using global `@property` or `:root` export const propertiesComponent = css`:host { ${Object.entries(customProperties).map(([name, { initialValue }]) => `--aegis-${name}: ${initialValue};\n`).join('\n')} }`; export const propertiesLegacy = css`:root { ${Object.entries(customProperties).map(([name, { initialValue }]) => `--aegis-${name}: ${initialValue};\n`).join('\n')} }`;