Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for more CSS units #264

Merged
merged 2 commits into from
Oct 5, 2024
Merged

Add support for more CSS units #264

merged 2 commits into from
Oct 5, 2024

Conversation

rodarima
Copy link
Member

@rodarima rodarima commented Oct 2, 2024

Add support for more CSS units and changes the parser representation to a struct, so we don't need to eat more bits from the unit values.

Closes #48 and #174

@rodarima rodarima self-assigned this Oct 2, 2024
@rodarima rodarima added this to the Release 3.2.0 milestone Oct 2, 2024
@rodarima rodarima mentioned this pull request Oct 3, 2024
4 tasks
The int type doesn't have a fixed size, and is only guarantee to hold 16
bits. The current implementation assumes a size of at least 32 bits, an
uses three bits to encode the type of information stored in the rest.

To add more types of lengths we would need to take more bits from the
value itself.

A simpler approach is just to use a enumeration to take care of the type
of length and a union to encapsulate the different lengths values.
Implements support for ch, rem, vw, vh, vmin and vmax units of CSS
lengths. For now the units relative to the viewport are only computed
once, and they won't change when the window is resized, but only when
the page is reloaded.

See: https://www.toomanyatoms.com/software/mobilized_dillo.html
Authored-By: dogma
@rodarima rodarima merged commit 08371f8 into master Oct 5, 2024
22 checks passed
@rodarima rodarima deleted the css-length-struct branch October 6, 2024 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing support for CSS units: ch, rem, vw, vh...
1 participant