Adds a new "class:" control-target kind (save_element_controls.py, _visible_attrs.py) alongside the existing content/attr/style ones, so a widget can carry CSS classes built from independent named slots (color, size, shape...) without them overwriting each other. Bouton and Titre get their Bulma base class (button/title) via fixed_attrs; Conteneur gets an opt-in "Carte (Bulma)" preset instead of a forced default, since it's also used as an invisible layout wrapper. Bouton's font-size/border-radius sliders no longer freeze their default value into inline style at creation (new c_slider no_freeze flag), so Bulma's own button styling shows through until a user actually customizes it — inline style still wins over any class the moment it's set, exactly like today. Loads bulma.min.css via CDN in screen_edit.html and play.html, same pattern as animate.css.
12 lines
706 B
Python
12 lines
706 B
Python
def c_slider(key, label, target, unit="px", min=0, max=100, step=1, default=16, group=None, no_freeze=False):
|
|
return {
|
|
"key": key, "label": label, "type": "slider", "target": target, "unit": unit,
|
|
"min": min, "max": max, "step": step, "default": default, "group": group,
|
|
# no_freeze : n'écrit PAS ce réglage en style au moment de la création
|
|
# de l'élément malgré sa valeur par défaut non-vide (voir
|
|
# default_style_and_attributes) — utilisé quand un widget porte déjà
|
|
# une classe CSS externe (ex. Bulma) qui doit rester visible tant que
|
|
# ce réglage n'a pas été explicitement personnalisé.
|
|
"no_freeze": no_freeze,
|
|
}
|