Skip to content

Can't use numerics as custom suffixes when allowSuffixToValue is true #125

Open
@src-code

Description

Right now it's not possible to have a custom suffix that's numeric if a rule has allowSuffixToValue set to true, such as Fz-10. Currently such a class would be translated into:

.Fz-10 {
  font-size: 10;
}

...which isn't valid.

The problem is that sometimes numerics are valid values, such as in the case of z-index, font-weight, or line-height, but in all other cases, a unit of measure (eg px) would be required.

I propose that we add a boolean to the rules that basically declares that for a given rule, the suffix-to-value requires a unit of measure. Something like suffixRequiresUnit, though I'm not sure how to best word it. By default this setting would be true, but would be false for the exceptions such as the ones listed above.

@renatoi @thierryk thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions