Helpers for generating valid strings for various languages.
npm install ttls-helpersA collection of helper methods to support generating language strings from JS.
``js
import { spread, toClassString, toStyleString, ifDefined, getUniqueId } from 'ttls-helpers';
import { html } from 'ttls-raw';
const niceColor = 'red';
html
`produces:
`html
Hello!
``js
import { atRules, rules } from 'ttls-helpers';atRules(
'container',
(name) => rules(
(value) =>
.d-${value}-${name}, ['hidden', 'initial'], 'display', ' '
),
{
sm: 'sm (min-width: 576px)',
md: 'md (min-width: 768px)'
}
);
`produces:
`css
@container sm (min-width: 576px) {
.d-hidden-sm {
display: hidden;
} .d-initial-sm {
display: initial;
}
}
@container md (min-width: 768px) {
.d-hidden-md {
display: hidden;
}
.d-initial-md {
display: initial;
}
}
``