mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-18 13:26:37 +00:00
Change = to : for named arguments
This commit is contained in:
committed by
Fabien Potencier
parent
fa8544ca4c
commit
99ea35e1e8
@@ -20,8 +20,8 @@ function where you define ``base`` classes that should always be present and the
|
|||||||
|
|
||||||
{# templates/alert.html.twig #}
|
{# templates/alert.html.twig #}
|
||||||
{% set alert = html_cva(
|
{% set alert = html_cva(
|
||||||
base='alert',
|
base: 'alert',
|
||||||
variants={
|
variants: {
|
||||||
color: {
|
color: {
|
||||||
blue: 'bg-blue',
|
blue: 'bg-blue',
|
||||||
red: 'bg-red',
|
red: 'bg-red',
|
||||||
@@ -84,8 +84,8 @@ when multiple other variant conditions are met:
|
|||||||
.. code-block:: html+twig
|
.. code-block:: html+twig
|
||||||
|
|
||||||
{% set alert = html_cva(
|
{% set alert = html_cva(
|
||||||
base='alert',
|
base: 'alert',
|
||||||
variants={
|
variants: {
|
||||||
color: {
|
color: {
|
||||||
blue: 'bg-blue',
|
blue: 'bg-blue',
|
||||||
red: 'bg-red',
|
red: 'bg-red',
|
||||||
@@ -97,7 +97,7 @@ when multiple other variant conditions are met:
|
|||||||
lg: 'text-lg',
|
lg: 'text-lg',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
compoundVariants=[{
|
compoundVariants: [{
|
||||||
// if color = red AND size = (md or lg), add the `font-bold` class
|
// if color = red AND size = (md or lg), add the `font-bold` class
|
||||||
color: ['red'],
|
color: ['red'],
|
||||||
size: ['md', 'lg'],
|
size: ['md', 'lg'],
|
||||||
@@ -128,8 +128,8 @@ If no variants match, you can define a default set of classes to apply:
|
|||||||
.. code-block:: html+twig
|
.. code-block:: html+twig
|
||||||
|
|
||||||
{% set alert = html_cva(
|
{% set alert = html_cva(
|
||||||
base='alert',
|
base: 'alert',
|
||||||
variants={
|
variants: {
|
||||||
color: {
|
color: {
|
||||||
blue: 'bg-blue',
|
blue: 'bg-blue',
|
||||||
red: 'bg-red',
|
red: 'bg-red',
|
||||||
@@ -146,7 +146,7 @@ If no variants match, you can define a default set of classes to apply:
|
|||||||
lg: 'rounded-lg',
|
lg: 'rounded-lg',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
defaultVariant={
|
defaultVariant: {
|
||||||
rounded: 'md',
|
rounded: 'md',
|
||||||
}
|
}
|
||||||
) %}
|
) %}
|
||||||
|
|||||||
Reference in New Issue
Block a user