From 33eda986e57773ed75fbc5c20420108d7e59a2bd Mon Sep 17 00:00:00 2001 From: Shinuwa Date: Thu, 5 Nov 2026 22:31:50 +0100 Subject: [PATCH] Restore the mythic aura outline in production builds Lightning CSS dropped mask-composite after the mask shorthand, so the crown and glow filled their whole area in production only. The exclusion now lives in the shorthand, with an E2E on the built site and a guard on the source. Co-Authored-By: Claude Opus 5.5 --- e2e/nebula-cards.spec.js | 4 ++++ tests/nebula-cards.test.mjs | 8 ++++++++ website/src/styles/_nebula-cards.scss | 5 +++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/e2e/nebula-cards.spec.js b/e2e/nebula-cards.spec.js index 9efc9ce..f46614a 100644 --- a/e2e/nebula-cards.spec.js +++ b/e2e/nebula-cards.spec.js @@ -1062,6 +1062,10 @@ test("administrator navigates sections, manages mythic content and previews visu expect(cardGlowVisual.map(({ side }) => side)).toEqual(["back", "face"]); for (const glow of cardGlowVisual) expect(glow).toMatchObject({ display: "block", backface: "hidden", animation: "nebula-opening-card-glow-palette-in" }); for (const glow of cardGlowVisual) expect(glow.background).toContain("conic-gradient"); + // La couronne et la lueur ne colorent que le contour : sans cette exclusion, qu'un minifieur peut retirer, l'aura remplit toute la zone. + const maskComposites = await mythicSurface.locator(":scope > .nebula-card-opening-crown-palette, :scope > .nebula-card-opening-glow-palette").evaluateAll((elements) => elements.map((element) => globalThis.getComputedStyle(element).maskComposite)); + expect(maskComposites).toHaveLength(2); + for (const composite of maskComposites) expect(composite).toMatch(/^exclude\b/); const mythicAuraPalettes = mythicSurface.locator(":scope > .nebula-card-opening-aura-palette, :scope > .nebula-card-opening-crown-palette"); await expect(mythicAuraPalettes).toHaveCount(2); const auraPaletteVisual = await mythicSurface.locator(":scope > .nebula-card-opening-aura-palette").evaluate((element) => { diff --git a/tests/nebula-cards.test.mjs b/tests/nebula-cards.test.mjs index 10f7a12..0cd3c30 100644 --- a/tests/nebula-cards.test.mjs +++ b/tests/nebula-cards.test.mjs @@ -24,6 +24,14 @@ const baseCatalog = prepareVersionedCatalog(rawCatalog); const TEST_MYTHIC_VARIATIONS = [{ editionId: "mythic-card-pull-spectral-prism-solar", cardId: "mythic-card-pull", finishId: "spectral-prism-solar", status: "active" }]; const catalog = buildPublishedCatalog(baseCatalog, { variations: TEST_MYTHIC_VARIATIONS, collectionStates: INITIAL_COLLECTION_STATES, dropRates: INITIAL_DROP_RATES }); +test("Sokko TCG styles keep mask compositions in a form the production minifier preserves", async () => { + const styles = await readFile("website/src/styles/_nebula-cards.scss", "utf8"); + // Lightning CSS retire un mask-composite séparé qui suit le raccourci mask : l'effet n'apparaît alors qu'en production. + for (const rule of styles.split("\n").filter((line) => /(^|[\s;{])mask:/.test(line))) { + assert.doesNotMatch(rule, /mask-composite:/, rule.slice(0, 80)); + } +}); + test("Sokko TCG uses design system dropdowns instead of native selects", async () => { const entries = await readdir("website/src/features/cards", { recursive: true }); const sources = entries.filter((entry) => entry.endsWith(".jsx")); diff --git a/website/src/styles/_nebula-cards.scss b/website/src/styles/_nebula-cards.scss index 3aacba3..95282b8 100644 --- a/website/src/styles/_nebula-cards.scss +++ b/website/src/styles/_nebula-cards.scss @@ -117,7 +117,8 @@ .nebula-card-reveal::after { position: absolute; z-index: 0; inset: -48px; display: none; content: ""; border: 3px solid color-mix(in srgb, var(--opening-aura, transparent) 72%, transparent); border-radius: 58px; background: radial-gradient(ellipse at center, color-mix(in srgb, var(--opening-aura, transparent) 68%, transparent) 0%, color-mix(in srgb, var(--opening-aura, transparent) 34%, transparent) 42%, transparent 72%); box-shadow: 0 0 28px color-mix(in srgb, var(--opening-aura, transparent) 78%, transparent), 0 0 64px color-mix(in srgb, var(--opening-aura, transparent) 48%, transparent); opacity: 0; pointer-events: none; filter: blur(3px) saturate(1.24); transform: scale(0.86); } .nebula-card-opening-aura-palette, .nebula-card-opening-crown-palette { position: absolute; z-index: 1; inset: -48px; display: none; box-sizing: border-box; border-radius: 58px; background: var(--opening-aura-gradient); opacity: 0; pointer-events: none; filter: blur(3px) saturate(1.24); transform: scale(0.86); } .nebula-card-opening-aura-palette { mask-image: radial-gradient(ellipse at center, black 0%, rgba(0, 0, 0, 0.48) 42%, transparent 72%); -webkit-mask-image: radial-gradient(ellipse at center, black 0%, rgba(0, 0, 0, 0.48) 42%, transparent 72%); } -.nebula-card-opening-crown-palette { padding: 3px; mask: linear-gradient(black 0 0) content-box, linear-gradient(black 0 0); mask-composite: exclude; -webkit-mask: linear-gradient(black 0 0) content-box, linear-gradient(black 0 0); -webkit-mask-composite: xor; } +// L'exclusion reste dans le raccourci : un mask-composite séparé est retiré par le minifieur du build, qui génère aussi les variantes -webkit-. +.nebula-card-opening-crown-palette { padding: 3px; mask: linear-gradient(black 0 0) content-box exclude, linear-gradient(black 0 0); } .nebula-card-reveal[data-reveal-phase="aura"]::after { display: block; animation: nebula-opening-aura var(--opening-aura-duration) ease-out both; } .nebula-card-reveal[data-reveal-phase="revealing"]::after { display: block; animation: nebula-opening-aura-release var(--opening-particle-duration, 700ms) ease-out both; } .nebula-card-reveal[data-reveal-phase="aura"] :is(.nebula-card-opening-aura-palette, .nebula-card-opening-crown-palette) { display: block; animation: nebula-opening-aura var(--opening-aura-duration) ease-out both; } @@ -129,7 +130,7 @@ .nebula-card-reveal[data-aura-palette]::after { box-shadow: none; } .nebula-card-reveal[data-aura-palette] .nebula-card-tilt-surface { filter: none !important; animation: none !important; } // Halo de la couronne : la boîte déborde de 80px autour de la couronne et n'en garde que l'extérieur, comme un box-shadow. -.nebula-card-opening-glow-palette { position: absolute; z-index: 1; inset: -128px; display: none; padding: 80px; opacity: 0; pointer-events: none; transform: scale(0.86); mask: linear-gradient(black 0 0) border-box, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='58'/%3E%3C/svg%3E") content-box no-repeat; mask-composite: exclude; -webkit-mask: linear-gradient(black 0 0) border-box, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='58'/%3E%3C/svg%3E") content-box no-repeat; -webkit-mask-composite: xor; } +.nebula-card-opening-glow-palette { position: absolute; z-index: 1; inset: -128px; display: none; padding: 80px; opacity: 0; pointer-events: none; transform: scale(0.86); mask: linear-gradient(black 0 0) border-box exclude, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100%25' height='100%25' rx='58'/%3E%3C/svg%3E") content-box no-repeat; } .nebula-card-opening-glow-palette > span { position: absolute; inset: 80px; } .nebula-card-opening-glow-palette > span::before, .nebula-card-opening-glow-palette > span::after { position: absolute; inset: 0; content: ""; border-radius: 58px; background: var(--opening-aura-gradient); } .nebula-card-opening-glow-palette > span::before { opacity: 0.78; filter: blur(14px) saturate(1.24); }