Skip to content

Add None, Inherit, Initial, and Unset instances for Transformation - #169

Merged
thomashoneyman merged 2 commits into
purescript-contrib:mainfrom
jibranshaikh0:transformation-keyword-instances
Nov 9, 2026
Merged

thomashoneyman merged 2 commits into
purescript-contrib:mainfrom
jibranshaikh0:transformation-keyword-instances

Conversation

@jibranshaikh0

@jibranshaikh0 jibranshaikh0 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Description of the change

Resolves #150.

Adds None, Inherit, Initial, and Unset instances for Transformation, so
transform none, transform inherit, transform initial, and transform unset
render transform: none, transform: inherit, transform: initial, and
transform: unset, all valid values of the transform property per the MDN
reference linked in the issue (inherit, initial and unset are CSS-wide
keywords; none is specific to this property).

The instance shape follows the repository's existing pattern for BoxShadow in
src/CSS/Box.purs, adapted with an explicit Transformation $ fromString "..."
wrapper because Transformation has no IsString instance. TransformOrigin
intentionally receives no None instance, since transform-origin does not
accept none.

A new test/CSS/TransformSpec.purs asserts the exact rendered output for all
four keywords and is wired into test/Main.purs, and a changelog entry is added
under "Unreleased" -> "New features".


Checklist:

Testing (exact scope)

Verified by automated validation in a clean checkout with the repository's own CI
commands (Node 22, purescript 0.15.16, spago 1.0.5, purs-tidy):

  • spago build --strict — passes with no warnings or errors
  • spago test — passes; the new spec confirms transform: none,
    transform: inherit, transform: initial, and transform: unset render
    exactly
  • purs-tidy check src test — passes

Verification is at the compiler and test-suite level only, matching how this
library is consumed (a compile-time DSL). No downstream application was built
with the patched library, and no manual testing beyond the automated suite
above was performed.

AI assistance disclosure: the implementation, tests, and this PR description
were prepared with AI assistance.

@thomashoneyman
thomashoneyman merged commit 671bba6 into purescript-contrib:main Nov 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Transform lacks None, Inherit, Initial, and Unset instances

2 participants