Skip to content

st-theme-node: Allow unitless integers for background-blur property#13827

Open
vinayakrastogi wants to merge 2 commits into
linuxmint:masterfrom
vinayakrastogi:master
Open

st-theme-node: Allow unitless integers for background-blur property#13827
vinayakrastogi wants to merge 2 commits into
linuxmint:masterfrom
vinayakrastogi:master

Conversation

@vinayakrastogi

Copy link
Copy Markdown

Previously, theme developers might encounter parsing issues or strict requirements if they attempted to define blur radii without explicit length units (like px). By supporting NUM_GENERIC types for the -blur property, this change improves developer ergonomics and makes the theme parser more forgiving and robust. It aligns the parser more closely with expected CSS/SASS behaviors where unitless integers are frequently used for scaling or rendering properties.

How was this implemented?
Added a new property check for -blur inside _st_theme_node_ensure_background.

The parser now explicitly checks if the CSS declaration value (decl->value) is a raw number (TERM_NUMBER & NUM_GENERIC).

If it is a unitless integer, it safely casts and assigns it directly to node->background_blur.

If it is not a generic number (e.g., it has a px or em unit), it smoothly falls back to the existing get_length_from_term_int helper function to resolve the value.

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.

1 participant