@inkoxide/style
v0.2.0
Published
Style values for Inkoxide: CSS units, colours and transforms read into the style object that @inkoxide/react and @inkoxide/tailwind build.
Readme
@inkoxide/style
Reads CSS values into Inkoxide styles: lengths, colours, flex, transforms, transform origins and object positions. @inkoxide/react uses it for style props and @inkoxide/tailwind for classes. To make PDFs, install @inkoxide/render.
Part of Inkoxide. Requires Node.js >=22; ES modules only.
npm install @inkoxide/styleUsage
import { parseColor, parseTransform, PT_PER_UNIT } from '@inkoxide/style';
parseColor('#f80'); // [1, 0.533333, 0, 1]
parseTransform('transform', 'rotate(10deg) translate(4px, 50%)'); // [{ rotate: 10 }, { translate: [3, '50%'] }]
PT_PER_UNIT.mm; // 2.834645669291339 (72 / 25.4)Licence
MIT
