Fix roll dialog CSS + JS: template <div> wrapper, moon-section, selectors

- Remplace <form class='roll-dialog celestopol'> par <div class='roll-dialog-content'>
  pour éviter les formulaires HTML imbriqués invalides (DialogV2 a son propre <form>)
- Corrige le sélecteur CSS de .roll-dialog.celestopol vers .application.roll-dialog .roll-dialog-content
- Remplace .form-group.form-moon par .moon-section (classe custom) pour éviter
  les conflits avec le CSS grid de FoundryVTT standard-form (label 130px de hauteur)
- Met à jour le script JS inline pour utiliser document.querySelector('.roll-dialog-content')
- Ajoute white-space: nowrap sur le label Destin pour éviter le wrapping sur 3 lignes
- Supprime .application.roll-dialog .window-content padding override (remplacé par dialog-content)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-03-28 17:21:18 +01:00
parent a581853f95
commit cff700bd3d
24 changed files with 1133 additions and 283 deletions

View File

@@ -1,22 +1,137 @@
// ─── Roll dialog ─────────────────────────────────────────────────────────────
.roll-dialog.celestopol {
padding: 8px 12px;
// DialogV2 sets roll-dialog class on the .application element, not on the form.
// All dialog content lives in .application.roll-dialog .dialog-content
.application.roll-dialog .window-content {
padding: 0 !important;
}
.application.roll-dialog .dialog-content {
padding: 0 !important;
display: block !important;
}
.application.roll-dialog .roll-dialog-content {
padding: 10px 14px;
font-family: var(--cel-font-body, "Palatino Linotype", serif);
min-width: 340px;
display: flex;
flex-direction: column;
gap: 0;
.roll-title {
// ── Bloc infos acteur ──
.roll-info-block {
background: var(--cel-green, #1b3828);
background-image: url("../assets/ui/fond_cadrille.jpg");
background-blend-mode: soft-light;
border-bottom: 2px solid var(--cel-orange, #c49a1a);
padding: 10px 14px 12px;
margin: -10px -14px 14px;
text-align: center;
font-family: var(--cel-font-title, "CopaseticNF", serif);
font-size: 1.1em;
color: var(--cel-orange, #c49a1a);
margin-bottom: 10px;
.separator {
margin: 0 6px;
color: var(--cel-border, #7a5c20);
.roll-actor {
font-family: var(--cel-font-title, "CopaseticNF", serif);
color: var(--cel-orange-light, #ddb84a);
font-size: 0.82em;
letter-spacing: 0.06em;
opacity: 0.85;
}
.roll-skill-line {
font-family: var(--cel-font-title, "CopaseticNF", serif);
font-size: 1.2em;
color: var(--cel-cream, #f0e8d4);
margin-top: 1px;
.stat-label { color: var(--cel-orange-light, #ddb84a); }
.sep { color: var(--cel-border, #7a5c20); margin: 0 4px; }
}
.roll-dice-summary {
margin-top: 8px;
padding: 5px 10px;
background: rgba(0,0,0,0.25);
border-radius: 4px;
.dice-breakdown {
display: flex;
align-items: baseline;
justify-content: center;
gap: 5px;
font-size: 0.85em;
color: var(--cel-cream, #f0e8d4);
.dval, .nb-dice {
font-family: var(--cel-font-title, "CopaseticNF", serif);
font-size: 1.6em;
color: var(--cel-orange, #c49a1a);
font-weight: bold;
line-height: 1;
}
.dlabel { font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.8; }
.dminus { color: #e8a0a0; font-weight: bold; }
.deq { opacity: 0.6; }
.ddice { font-size: 1em; color: var(--cel-orange, #c49a1a); }
}
.wound-info {
font-size: 0.75em;
color: #e8a0a0;
margin-top: 3px;
}
}
}
// ── Phases de lune ──
.moon-section {
display: flex;
flex-direction: column;
gap: 4px;
margin-bottom: 10px;
.moon-section-label {
font-size: 0.75em;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--cel-orange, #c49a1a);
}
.moon-phases {
display: flex;
flex-wrap: wrap;
gap: 4px;
.moon-option {
display: flex;
flex-direction: column;
align-items: center;
cursor: pointer;
padding: 4px 5px;
border-radius: 3px;
border: 1px solid transparent;
flex: 1;
min-width: 52px;
transition: all 0.15s;
&:hover {
background: rgba(196,154,26,0.12);
border-color: var(--cel-border, #7a5c20);
}
&.active {
background: rgba(27,56,40,0.15);
border-color: var(--cel-orange, #c49a1a);
}
.moon-symbol { font-size: 1.4em; line-height: 1; }
.moon-name { font-size: 0.6em; text-align: center; margin-top: 2px; color: #555; }
.moon-bonus { font-size: 0.7em; color: var(--cel-orange, #c49a1a); font-weight: bold; }
}
}
}
// ── Champs de formulaire ──
.form-group {
display: flex;
align-items: center;
@@ -24,8 +139,8 @@
margin-bottom: 8px;
label {
flex: 0 0 140px;
font-size: 0.85em;
flex: 0 0 130px;
font-size: 0.82em;
text-transform: uppercase;
letter-spacing: 0.04em;
color: var(--cel-orange, #c49a1a);
@@ -35,23 +150,62 @@
flex: 1;
border: 1px solid var(--cel-border, #7a5c20);
border-radius: 2px;
padding: 2px 6px;
background: rgba(255,255,255,0.7);
padding: 3px 6px;
background: rgba(255,255,255,0.75);
font-family: inherit;
}
&.form-row label { flex: 0 0 130px; }
}
.form-two-col {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
margin-bottom: 8px;
.form-group {
flex-direction: column;
align-items: stretch;
margin-bottom: 0;
label {
flex: none;
margin-bottom: 2px;
}
}
}
.form-destin {
margin-bottom: 10px;
.destin-label {
display: flex;
align-items: center;
gap: 6px;
cursor: pointer;
color: var(--cel-orange, #c49a1a);
font-size: 0.85em;
white-space: nowrap;
flex-wrap: nowrap;
input[type="checkbox"] { width: 14px; height: 14px; flex-shrink: 0; }
.destin-icon { font-size: 1em; flex-shrink: 0; }
}
}
// ── Prévisualisation ──
.dice-preview {
text-align: center;
font-size: 1em;
margin-top: 10px;
padding: 6px;
margin-top: 4px;
padding: 8px;
background: rgba(27,56,40,0.08);
border-radius: 3px;
border: 1px solid var(--cel-green, #1b3828);
.nb-dice {
.preview-formula {
font-family: var(--cel-font-title, "CopaseticNF", serif);
font-size: 1.5em;
font-size: 1.4em;
color: var(--cel-orange, #c49a1a);
font-weight: bold;
}
@@ -66,6 +220,7 @@
overflow: hidden;
font-family: var(--cel-font-body, "Palatino Linotype", serif);
// ── En-tête ──
.roll-header {
display: flex;
align-items: center;
@@ -77,100 +232,183 @@
border-bottom: 2px solid var(--cel-orange, #c49a1a);
.actor-img {
width: 36px;
height: 36px;
width: 40px;
height: 40px;
object-fit: cover;
border: 1px solid var(--cel-orange, #c49a1a);
border-radius: 2px;
box-shadow: inset 0 0 4px rgba(196,154,26,0.3);
flex-shrink: 0;
}
.roll-info {
flex: 1;
display: flex;
flex-direction: column;
gap: 1px;
.actor-name {
font-family: var(--cel-font-title, "CopaseticNF", serif);
color: var(--cel-orange, #c49a1a);
font-weight: bold;
letter-spacing: 0.05em;
font-size: 0.95em;
}
.skill-info {
color: var(--cel-cream, #f0e8d4);
font-size: 0.8em;
font-size: 0.78em;
font-style: italic;
.stat-lbl { color: var(--cel-orange-light, #ddb84a); }
.sep { margin: 0 2px; color: var(--cel-border, #7a5c20); }
}
}
}
.roll-details {
padding: 8px;
background: var(--cel-cream, #f0e8d4);
.dice-results {
display: flex;
gap: 4px;
flex-wrap: wrap;
margin-bottom: 6px;
.die.d6 {
display: inline-flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
border: 2px solid var(--cel-border, #7a5c20);
border-radius: 3px;
background: white;
font-weight: bold;
font-size: 1em;
.wound-info {
font-size: 0.72em;
color: #e8a0a0;
}
}
.bonus-line {
display: flex;
justify-content: space-between;
font-size: 0.85em;
color: #666;
padding: 1px 0;
}
.roll-total-line {
.moon-badge {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
margin-top: 6px;
padding-top: 4px;
border-top: 1px solid var(--cel-border, #7a5c20);
font-size: 0.75em;
.moon-sym { font-size: 1.3em; line-height: 1; }
.moon-bon { color: var(--cel-orange-light, #ddb84a); font-weight: bold; }
}
}
.total-label {
text-transform: uppercase;
font-size: 0.75em;
// ── Zone dés ──
.dice-zone {
display: flex;
flex-wrap: wrap;
gap: 5px;
padding: 8px 10px 4px;
background: var(--cel-cream, #f0e8d4);
justify-content: center;
.die-face {
display: inline-flex;
align-items: center;
justify-content: center;
width: 30px;
height: 30px;
border: 2px solid var(--cel-border, #7a5c20);
border-radius: 4px;
background: white;
font-weight: bold;
font-size: 1em;
font-family: var(--cel-font-title, "CopaseticNF", serif);
box-shadow: 1px 1px 2px rgba(0,0,0,0.15);
&.max {
background: var(--cel-green, #1b3828);
color: var(--cel-orange, #c49a1a);
border-color: var(--cel-orange, #c49a1a);
}
.total-value {
font-family: var(--cel-font-title, "CopaseticNF", serif);
font-size: 1.6em;
font-weight: bold;
color: var(--cel-orange, #c49a1a);
}
.vs-difficulty {
font-size: 0.8em;
color: #888;
&.min {
background: #f9e8e8;
color: #a03030;
border-color: #c07070;
}
}
}
.roll-result-banner {
// ── Formule ──
.formula-line {
display: flex;
flex-wrap: wrap;
align-items: baseline;
justify-content: center;
gap: 3px;
padding: 4px 10px;
background: var(--cel-cream, #f0e8d4);
font-size: 0.85em;
color: #555;
.fl-ndice { color: var(--cel-green, #1b3828); font-weight: bold; }
.fl-sum { font-weight: bold; }
.fl-total {
font-family: var(--cel-font-title, "CopaseticNF", serif);
font-size: 1.4em;
color: var(--cel-orange, #c49a1a);
font-weight: bold;
}
.fl-moon { color: #666; }
.fl-mod { color: #444; }
.fl-asp { color: var(--cel-orange, #c49a1a); }
.fl-sep { font-weight: bold; color: var(--cel-border, #7a5c20); margin: 0 2px; }
.fl-eq { color: #888; }
.fl-op { color: #888; }
}
// ── Seuil et marge ──
.threshold-line {
display: flex;
align-items: center;
justify-content: center;
gap: 5px;
padding: 4px 10px 6px;
background: var(--cel-cream, #f0e8d4);
border-top: 1px solid rgba(122,92,32,0.25);
font-size: 0.82em;
.vs-label { color: #888; text-transform: uppercase; font-size: 0.85em; }
.diff-label{ font-style: italic; color: var(--cel-green, #1b3828); }
.diff-val { color: #888; }
.margin-badge {
margin-left: 6px;
padding: 1px 7px;
border-radius: 10px;
font-weight: bold;
font-size: 0.95em;
font-family: var(--cel-font-title, "CopaseticNF", serif);
&.above {
background: var(--cel-green, #1b3828);
color: var(--cel-orange, #c49a1a);
border: 1px solid var(--cel-orange, #c49a1a);
}
&.below {
background: var(--cel-accent, #6b1e28);
color: #e8c8c8;
border: 1px solid #8b3e48;
}
}
}
// ── Destin utilisé ──
.used-info {
text-align: center;
padding: 5px 8px;
font-size: 0.78em;
color: var(--cel-orange, #c49a1a);
padding: 2px 8px;
background: var(--cel-cream-dark, #e0d4b8);
border-top: 1px dashed var(--cel-border, #7a5c20);
}
// ── Bandeau résultat ──
.roll-result-banner {
display: flex;
flex-direction: column;
align-items: center;
padding: 6px 8px;
font-family: var(--cel-font-title, "CopaseticNF", serif);
font-size: 1.1em;
text-transform: uppercase;
letter-spacing: 0.1em;
// Success: jade green with gold text — elegant
.result-icon { font-size: 0.9em; opacity: 0.8; }
.result-label { font-size: 1.15em; line-height: 1.2; }
.result-desc {
font-size: 0.65em;
letter-spacing: 0.12em;
margin-top: 1px;
opacity: 0.85;
text-transform: none;
font-style: italic;
font-family: var(--cel-font-body, serif);
}
&.success {
background-color: var(--cel-green, #1b3828);
background-image: url("../assets/ui/fond_cadrille.jpg");
@@ -178,16 +416,26 @@
color: var(--cel-orange, #c49a1a);
}
// Failure: deep burgundy — dark and grave
&.critical-success {
background: linear-gradient(135deg, #1b3828, #2c5a3f);
background-image: url("../assets/ui/fond_cadrille.jpg");
background-blend-mode: soft-light;
color: var(--cel-orange-light, #ddb84a);
border-top: 2px solid var(--cel-orange, #c49a1a);
border-bottom: 2px solid var(--cel-orange, #c49a1a);
text-shadow: 0 0 8px rgba(196,154,26,0.5);
}
&.failure {
background: var(--cel-accent, #6b1e28);
color: #e8c8c8;
}
.critical {
display: block;
font-size: 0.75em;
letter-spacing: 0.12em;
&.critical-failure {
background: linear-gradient(135deg, #3d0f18, #6b1e28);
color: #f0c8c8;
border-top: 2px solid #8b3e48;
border-bottom: 2px solid #8b3e48;
}
}
}