sokko-g/website/src/styles/design-system/controls/_checkboxes.scss
Shinuwa db93420daf
Some checks failed
Validate and deploy Sokko G / deploy (push) Blocked by required conditions
Validate and deploy Sokko G / validate (push) Has been cancelled
Document every Sass mixin and function with SassDoc and drop the unused ones
Each @mixin and @function now has a /// block: what it draws and when to use
it, its parameters with their accepted values, and the mixin that goes with
it. VS Code shows it on hover with SCSS IntelliSense. Ten mixins that nothing
included are removed; the built CSS is byte-identical. tests/static-styles
now requires the block, and website/AGENTS.md gives the template.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 16:22:36 +01:00

101 lines
3 KiB
SCSS

// Rôle : regroupe les mixins de cases à cocher.
/// Case à cocher du design system, dessinée sur l'`input` natif (`appearance: none`).
/// @param {String} $size [md] - Côté : `md` (20 px), `sm` (18 px) ou `xs` (14 px).
/// @see {mixin} checkbox-check
@mixin checkbox-control($size: md) {
$control-size: 20px;
$radius: 3px;
@if $size == xs {
$control-size: 14px;
} @else if $size == sm {
$control-size: 18px;
}
appearance: none;
-webkit-appearance: none;
display: inline-grid;
width: $control-size;
min-width: $control-size;
max-width: $control-size;
inline-size: $control-size;
min-inline-size: $control-size;
max-inline-size: $control-size;
aspect-ratio: 1;
height: $control-size;
min-height: $control-size;
max-height: $control-size;
block-size: $control-size;
min-block-size: $control-size;
max-block-size: $control-size;
place-content: center;
margin: 0;
padding: 0;
border: 1px solid transparent;
border-radius: $radius;
line-height: 0;
background:
linear-gradient(135deg, rgba(27, 34, 66, 0.92), rgba(16, 20, 44, 0.94)) padding-box,
linear-gradient(135deg, rgba(246, 196, 83, 0.5), rgba(139, 92, 246, 0.44)) border-box;
box-shadow:
inset 0 0 0 1px rgba(255, 255, 255, 0.06),
0 0 0 1px rgba(5, 7, 17, 0.42);
cursor: pointer;
}
/// Coche dessinée dans la case (pseudo-élément), cachée tant que la case n'est pas cochée.
/// @param {String} $size [md] - Même taille que la case.
/// @see {mixin} checkbox-checked-check
@mixin checkbox-check($size: md) {
$check-size: 11px;
@if $size == xs {
$check-size: 8px;
} @else if $size == sm {
$check-size: 10px;
}
content: "";
width: $check-size;
height: $check-size;
background: #fff;
transform: scale(0);
transition: transform var(--duration-fast) var(--ease-standard);
clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 18%, 84% 5%, 34% 68%);
}
/// Survol d'une case à cocher : bordure et halo dorés.
@mixin checkbox-hover {
border-color: rgba(246, 196, 83, 0.6);
box-shadow:
inset 0 0 0 1px rgba(255, 255, 255, 0.04),
0 0 14px rgba(246, 196, 83, 0.14);
}
/// Case cochée : fond en dégradé doré et violet.
@mixin checkbox-checked {
border-color: rgba(246, 196, 83, 0.88);
background:
linear-gradient(135deg, rgba(246, 196, 83, 0.96), rgba(139, 92, 246, 0.86)) padding-box,
linear-gradient(135deg, var(--color-accent-gold), rgba(196, 181, 253, 0.88)) border-box;
box-shadow:
inset 0 0 0 1px rgba(255, 255, 255, 0.12),
0 0 16px rgba(246, 196, 83, 0.2);
}
/// Fait apparaître la coche d'une case cochée.
@mixin checkbox-checked-check {
transform: scale(1);
}
/// Case à cocher désactivée : grisée, curseur « interdit ».
@mixin checkbox-disabled {
border-color: rgba(165, 180, 252, 0.08);
background:
linear-gradient(135deg, rgba(148, 163, 184, 0.08), rgba(51, 65, 85, 0.12)) padding-box,
linear-gradient(135deg, rgba(148, 163, 184, 0.16), rgba(99, 102, 241, 0.08)) border-box;
box-shadow: none;
cursor: not-allowed;
opacity: 0.48;
}