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

Disable automatic var() injection for anchor properties #13826

Merged
merged 3 commits into from
Jun 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update tests
  • Loading branch information
thecrypticace committed Jun 12, 2024
commit eb5ee9279d92fb6da681a87588d7a07184d54d5f
45 changes: 44 additions & 1 deletion tests/normalize-data-types.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,18 @@ it('should not automatically inject the `var()` for properties that accept `<das
{ raw: '[color:--foo]' },

// Automatic var injection is skipped
{ raw: '[scroll-timeline-name:--foo]' },
{ raw: '[timeline-scope:--foo]' },
{ raw: '[view-timeline-name:--foo]' },
{ raw: '[font-palette:--foo]' },
{ raw: '[anchor-name:--foo]' },
{ raw: '[anchor-scope:--foo]' },
{ raw: '[position-anchor:--foo]' },
{ raw: '[position-try-options:--foo]' },
{ raw: '[scroll-timeline:--foo]' },
{ raw: '[animation-timeline:--foo]' },
{ raw: '[view-timeline:--foo]' },
{ raw: '[position-try:--foo]' },
],
}

Expand All @@ -122,13 +133,45 @@ it('should not automatically inject the `var()` for properties that accept `<das

return run(input, config).then((result) => {
expect(result.css).toMatchFormattedCss(css`
.\[anchor-name\:--foo\] {
anchor-name: --foo;
}
.\[anchor-scope\:--foo\] {
anchor-scope: --foo;
}
.\[animation-timeline\:--foo\] {
animation-timeline: --foo;
}
.\[color\:--foo\] {
color: var(--foo);
}

.\[font-palette\:--foo\] {
font-palette: --foo;
}
.\[position-anchor\:--foo\] {
position-anchor: --foo;
}
.\[position-try-options\:--foo\] {
position-try-options: --foo;
}
.\[position-try\:--foo\] {
position-try: --foo;
}
.\[scroll-timeline-name\:--foo\] {
scroll-timeline-name: --foo;
}
.\[scroll-timeline\:--foo\] {
scroll-timeline: --foo;
}
.\[timeline-scope\:--foo\] {
timeline-scope: --foo;
}
.\[view-timeline-name\:--foo\] {
view-timeline-name: --foo;
}
.\[view-timeline\:--foo\] {
view-timeline: --foo;
}
`)
})
})
Loading