Skip to content

Commit

Permalink
minor #4502 Change = to : for named arguments (seb-jean)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Change `=` to `:` for named arguments

Hi,
I changed `=` to `:` because it better follows best practices for named arguments.

Commits
-------

99ea35e Change `=` to `:` for named arguments
  • Loading branch information
fabpot committed Dec 14, 2024
2 parents fa8544c + 99ea35e commit dc2949e
Showing 1 changed file with 8 additions and 8 deletions.
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

0 comments on commit dc2949e

Please sign in to comment.