Skip to content

Commit

Permalink
fix: handle boolean css var (#2350)
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm authored Apr 25, 2024
1 parent fcc148d commit c924fba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/svelte2tsx/src/htmlxtojsx_v2/nodes/Attribute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export function handleAttribute(
element.addAttribute(name, value);
}
: (name: TransformationArray, value?: TransformationArray) => {
if (attr.name.startsWith('--') && attr.value !== true) {
if (attr.name.startsWith('--')) {
// CSS custom properties are not part of the props
// definition, so wrap them to not get "--xx is invalid prop" errors
name.unshift('...__sveltets_2_cssProp({');
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
betweenprop
--custom-css-property3="hi{jo}hi"
--custom-css-property4='hi{jo}hi'
--custom-css-property5=hi{jo}hi />
--custom-css-property5=hi{jo}hi
--custom-css-property6 />

0 comments on commit c924fba

Please sign in to comment.