Skip to content

Conversation

@nsaunders
Copy link
Owner

Description

This change adds a new unsafeDeclaration function that can be used within a ruleset to unsafely add a declaration. Useful for vendor-prefixed properties, or those that might be too new or experimental to have been added to this library yet.

Design considerations

  • There is no operator for this because I couldn't think of one that conveyed the notion of "unsafe".
  • I considered implementing this with a signature of unsafeDeclaration :: ToVal a => String -> a -> ..., allowing users to write e.g. unsafeDeclaration "--foo" 0 instead of unsafeDeclaration "--foo" "0", but I decided against this because I don't want to make the API too friendly. Its use should generally be discouraged.

Future plans

Make sure to stay on top of adding new CSS properties so that folks don't lean on this too heavily.

References

Provide links to related issues, W3C specifications, MDN articles, or other supporting resources.

Code change checklist

  • Any new or updated functionality includes corresponding unit test coverage.
  • I have verified code formatting, run the unit tests, and checked for any changes in the examples.
  • I have added an entry to the Unreleased section of the CHANGELOG.

@nsaunders nsaunders added the enhancement New feature or request label May 15, 2023
@nsaunders nsaunders merged commit 7f63d01 into master May 15, 2023
@nsaunders nsaunders deleted the feature/unsafe-declaration branch July 27, 2023 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants