{% extends 'base.html.twig' %} {% block title %}Gradient Text - Design System - Bubul{% endblock %} {% block body %}
{# ===== EXPLICATION ===== #}
{% include '_atoms/icon/icon.html.twig' with { name: 'text', size: 'lg', color: 'white' } %}

Gradient Text

Nouveau

Atome minimal qui genere un texte avec degrade de couleur via background-clip: text. Supporte n'importe quelle direction et n'importe quelles couleurs de depart et d'arrivee. Peut s'utiliser avec n'importe quelle balise HTML (span, strong, em...).

1

Ligne de HTML

6

Parametres

inline

Usage

any

Tag HTML

{# ===== EXEMPLES VISUELS ===== #}

Exemples visuels

Differents gradients disponibles

Defaut — Bleu primaire (from: #0C81E4, to: #3AB8E8)

La plateforme IA qui {% include '_atoms/gradient-text/gradient-text.html.twig' with { text: 'change tout.', from: '#0C81E4', to: '#3AB8E8' } only %}

Slidia — Rose-Violet (from: #C4167A, to: #EC4899)

Des slides {% include '_atoms/gradient-text/gradient-text.html.twig' with { text: 'professionnels', from: '#C4167A', to: '#EC4899' } only %} en 2 minutes.

Serenia — Violet (from: #7C3AED, to: #A78BFA)

L'IA {% include '_atoms/gradient-text/gradient-text.html.twig' with { text: 'securisee', from: '#7C3AED', to: '#A78BFA' } only %} orientee pedagogie.

Castia — Vert (from: #267A35, to: #34D399)

Des podcasts {% include '_atoms/gradient-text/gradient-text.html.twig' with { text: 'pedagogiques', from: '#267A35', to: '#34D399' } only %} en quelques secondes.

Direction modifiee — Horizontal (90deg)

{% include '_atoms/gradient-text/gradient-text.html.twig' with { text: 'Gradient horizontal', from: '#0891B2', to: '#38BDF8', direction: '90deg' } only %}

Balise strong

Utilisez Bubul pour {% include '_atoms/gradient-text/gradient-text.html.twig' with { text: 'gagner du temps', from: '#ED8600', to: '#F59E0B', tag: 'strong' } only %} sur vos formations.

{# ===== UTILISATION ===== #}

Utilisation

Exemples de code Twig

Usage basique dans un titre

{% verbatim %}

Vous avez le fond. {% include '_atoms/gradient-text/gradient-text.html.twig' with { text: 'Slidia fait la forme.', from: '#C4167A', to: '#EC4899' } only %}

{% endverbatim %}

Usage dans titleHtml (ne supporte pas include)

{% verbatim %}{# Pour les parametres titleHtml qui ne supportent pas {% include %} #}
{% set c1 = '#0C81E4' %}
{% set c2 = '#3AB8E8' %}
{% set gtStyle = 'background:linear-gradient(135deg,' ~ c1 ~ ',' ~ c2 ~ ');-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;' %}

{% include '_organisms/landing/steps-tool.html.twig' with {
    titleHtml: '4 etapes. 3 minutes.'
} only %}{% endverbatim %}
{# ===== PARAMETRES ===== #}

Parametres

Options de configuration

Parametre Type Defaut Description
text string '' Texte a afficher en gradient
from string '#0C81E4' Couleur de debut du degrade (format hex ou rgb)
to string '#3AB8E8' Couleur de fin du degrade (format hex ou rgb)
direction string '135deg' Direction CSS du degrade (135deg, 90deg, to right, etc.)
tag string 'span' Balise HTML rendue (span, strong, em, b...)
class string '' Classes CSS additionnelles sur la balise
{# ===== NOTES TECHNIQUES ===== #}

Notes Techniques

Implementation

1

background-clip: text

Le gradient est applique en background avec -webkit-background-clip: text; -webkit-text-fill-color: transparent; pour que le degrade soit visible uniquement sur le texte.

2

Alternative pour titleHtml

Quand le gradient est necessaire dans un parametre titleHtml (qui ne supporte pas {% verbatim %}{% include %}{% endverbatim %}), construire le style CSS en Twig via une variable gtStyle et l'injecter via un <span style="...">.

3

Chemin du fichier

templates/_atoms/gradient-text/gradient-text.html.twig

{% endblock %}