Skip to content

Commit 81f7d24

Browse files
committed
minor #1580 [TwigComponent] fix typo in compoundVariants documentation (o0morgan0o)
This PR was merged into the 2.x branch. Discussion ---------- [TwigComponent] fix typo in compoundVariants documentation | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | Issues | - | License | MIT I think there is a typo in the documentation in the compoundVariants part, and it made me confused a little. The example in the doc was throwing `An exception has been thrown during the rendering of a template ("Warning: foreach() argument must be of type array|object, string given").` Commits ------- d466626 fix: typo in compoundVariant documentation
2 parents 2ddc47b + d466626 commit 81f7d24

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/TwigComponent/doc/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,12 +1167,12 @@ when multiple other variant conditions are met.
11671167
lg: 'text-lg',
11681168
}
11691169
},
1170-
compoundVariants: {
1171-
// if colors=red AND size = (md or lg), add the `font-bold` class
1172-
colors: ['red'],
1170+
compoundVariants: [{
1171+
// if color = red AND size = (md or lg), add the `font-bold` class
1172+
color: ['red'],
11731173
size: ['md', 'lg'],
11741174
class: 'font-bold'
1175-
}
1175+
}]
11761176
}) %}
11771177

11781178
<div class="{{ alert.apply({color, size}) }}">

0 commit comments

Comments
 (0)