lukejacksonn / oceanwind

Compiles tailwind shorthand into css at runtime. Succeeded by Twind.
https://twind.dev
264 stars 12 forks source link

Theme alignment #19

Closed lukejacksonn closed 3 years ago

lukejacksonn commented 3 years ago

Fixes #8

Started out by refactoring the theme, that meant making changes to translations and tests.

Some theme properties needed renaming others needed adding. Some properties were purposefully left out either because they are verbose and the translate functions doesn't require them (for example when the options are enumerable) and/or they are unlikely to be overridden (like position):

// backgroundPosition: x ~> x | x-x ~> x x,
// container: {},
// cursor: x ~> x
// inset: x ~> x
// listStyleType: x ~> x
// objectPosition: x ~> x | x-x ~> x x,
// gridTemplateColumns: x ~> x | x ~> repeat(x, minmax(0, 1fr))
// gridColumn: x ~> span x / span x
// gridColumnStart: x ~> x
// gridColumnEnd: x ~> x
// gridTemplateRows: x ~> x | x ~> repeat(x, minmax(0, 1fr))
// gridRow: x ~> span x / span x
// gridRowStart: x ~> x
// gridRowEnd: x ~> x
// transformOrigin: x ~> x | x-x ~> x x,

These could be added at any time if it causes considerable issues but I'd rather not at the moment for the sakes of saving some file size. That said, it would be nice for the configs to be exactly the same.

Because of the inheritance within the theme, a new (and more cumbersome) kind of merge is required to extend the theme. It works for now but I'm up for suggestions as to how this would be done better.

lukejacksonn commented 3 years ago

This probably isn't perfect but I'm going to merge it so that I can get on with fixing up some other stuff!

bebraw commented 3 years ago

Nice work. 👍