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

[Chore] Invalid CSS syntax generated by variables with no default value #1657

Open
ko2in opened this issue Aug 25, 2020 · 1 comment
Open
Labels
state/awaiting-investigation Anything which needs more investigation type/bug Any issue which is a bug or PR which fixes a bug type/discussion Anything which is up for discussion

Comments

@ko2in
Copy link
Member

ko2in commented Aug 25, 2020

Description

Some variable files contain the variables with no default value, which resulted the LESS file to generate the invalid CSS syntax. Example: a variable @searchMinWidth with empty value would generate an invalid CSS declaration min-width: ''.

Which produces an invalid CSS like:
Dropdown

Literally, the min-width declaration is not required at all, if there's no value for that. The browsers will be ignored any invalid CSS declaration, however it's still an error and violating CSS rules, and thus should be avoided.

There can be several variable files which could produce this outcome and all of these variables should be reviewed and remove the corresponding CSS declarations which bound to those variables.

I proposed this for the following reasons:

  • To avoid any undesired outcomes when the browsers changed their behavior for dealing with invalid CSS syntax in the future
  • The user could avoid having the alert for any invalid CSS syntax when using the CSS linter
  • To keep FUI following CSS specifications as much as possible and have valid syntax
@ko2in ko2in added type/bug Any issue which is a bug or PR which fixes a bug type/discussion Anything which is up for discussion state/awaiting-investigation Anything which needs more investigation labels Aug 25, 2020
@lubber-de
Copy link
Member

lubber-de commented Aug 26, 2020

Those invalid values might only exists in the default theme. Custom themes could potentially have set valid values for those variables, so we cannot remove them in general without being a breaking change.
We should rather look into some feature/linter on LESS build time to not render CSS attributes if they are invalid.

@ko2in ko2in pinned this issue Oct 19, 2023
@ko2in ko2in unpinned this issue Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state/awaiting-investigation Anything which needs more investigation type/bug Any issue which is a bug or PR which fixes a bug type/discussion Anything which is up for discussion
Projects
None yet
Development

No branches or pull requests

2 participants