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

Change = to : for named arguments #4502

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Changes from all commits
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
16 changes: 8 additions & 8 deletions doc/functions/html_cva.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ function where you define ``base`` classes that should always be present and the

{# templates/alert.html.twig #}
{% set alert = html_cva(
base='alert',
variants={
base: 'alert',
variants: {
color: {
blue: 'bg-blue',
red: 'bg-red',
Expand Down Expand Up @@ -84,8 +84,8 @@ when multiple other variant conditions are met:
.. code-block:: html+twig

{% set alert = html_cva(
base='alert',
variants={
base: 'alert',
variants: {
color: {
blue: 'bg-blue',
red: 'bg-red',
Expand All @@ -97,7 +97,7 @@ when multiple other variant conditions are met:
lg: 'text-lg',
}
},
compoundVariants=[{
compoundVariants: [{
// if color = red AND size = (md or lg), add the `font-bold` class
color: ['red'],
size: ['md', 'lg'],
Expand Down Expand Up @@ -128,8 +128,8 @@ If no variants match, you can define a default set of classes to apply:
.. code-block:: html+twig

{% set alert = html_cva(
base='alert',
variants={
base: 'alert',
variants: {
color: {
blue: 'bg-blue',
red: 'bg-red',
Expand All @@ -146,7 +146,7 @@ If no variants match, you can define a default set of classes to apply:
lg: 'rounded-lg',
}
},
defaultVariant={
defaultVariant: {
rounded: 'md',
}
) %}
Expand Down
Loading