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 more validation to CSSProperties #3

Open
suryarajendhran opened this issue Aug 15, 2021 · 0 comments
Open

Add more validation to CSSProperties #3

suryarajendhran opened this issue Aug 15, 2021 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@suryarajendhran
Copy link
Owner

The CSS values that are passed to modify the CSS property should be valid, else the properties will not be overridden. So adding validation should help.

(Although this might be partly solved by checking whether the properties are actually modified after the fact but that is not the most accurate way to check if an invalid CSS value was provided. CSS properties could be overridden by other higher precedence property/rule or in cases where the CSS is dynamically manipulated.)

For example, the following function will fail to actually modify the CSS rule but no errors will be thrown.

import { modifyCSSRule } from 'change-css';

modifyCSSRule('body', {
  color: '#01g'
});
@suryarajendhran suryarajendhran added enhancement New feature or request help wanted Extra attention is needed labels Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant