/* * FunnelFork front end. * * Colours, fonts and buttons follow the active theme (theme.json presets). * Override the custom properties below to restyle a scan. */ .funnelfork { --funnelfork-accent: var(--wp--preset--color--primary, var(--wp--preset--color--contrast, currentColor)); --funnelfork-text: inherit; --funnelfork-muted: color-mix(in srgb, currentColor 60%, transparent); --funnelfork-border: color-mix(in srgb, currentColor 18%, transparent); --funnelfork-surface: color-mix(in srgb, currentColor 4%, transparent); --funnelfork-danger: #b42318; --funnelfork-radius: 10px; --funnelfork-gap: 1.25rem; --funnelfork-speed: 0.45s; color: var(--funnelfork-text); max-width: 720px; margin-inline: auto; position: relative; &:not(.is-ready) > template { display: none; } } .funnelfork__header { display: flex; align-items: center; gap: 1rem; margin-bottom: var(--funnelfork-gap); min-height: 2.25rem; &[hidden] { display: none; } } .funnelfork__back { background: none; border: 0; padding: 0.4rem 0; color: inherit; font: inherit; font-size: 0.9em; cursor: pointer; opacity: 0.75; white-space: nowrap; &::before { content: "← "; } &:hover, &:focus-visible { opacity: 1; text-decoration: underline; } &[hidden] { display: inline-block; visibility: hidden; } } .funnelfork__progress { flex: 1; height: 6px; border-radius: 3px; background: var(--funnelfork-border); overflow: hidden; } .funnelfork__progress-bar { height: 100%; width: 0; background: var(--funnelfork-accent); border-radius: inherit; transition: width var(--funnelfork-speed) ease; } .funnelfork__viewport { position: relative; overflow: hidden; transition: height var(--funnelfork-speed) ease; } .funnelfork__slide { transition: transform var(--funnelfork-speed) cubic-bezier(0.22, 0.61, 0.36, 1), opacity var(--funnelfork-speed) ease; padding: 2px; /* Room for focus outlines. */ &.is-entering { position: absolute; inset: 0 0 auto 0; } } .funnelfork__eyebrow { margin: 0 0 0.35rem; font-size: 0.85em; color: var(--funnelfork-muted); text-transform: uppercase; letter-spacing: 0.06em; } .funnelfork__title { margin: 0 0 0.75rem; &:focus { outline: none; } } .funnelfork__description, .funnelfork__intro { margin: 0 0 var(--funnelfork-gap); color: var(--funnelfork-muted); } .funnelfork__start { margin-top: 0.5rem; cursor: pointer; } .funnelfork__answers { display: grid; gap: 0.75rem; margin-top: var(--funnelfork-gap); } .is-yesno .funnelfork__answers { grid-template-columns: repeat(2, minmax(0, 1fr)); } .funnelfork__answer { display: flex; align-items: center; gap: 0.75rem; width: 100%; padding: 1rem 1.25rem; border: 2px solid var(--funnelfork-border); border-radius: var(--funnelfork-radius); background: var(--funnelfork-surface); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease; &:hover, &:focus-visible { border-color: var(--funnelfork-accent); } &:focus-visible { outline: 2px solid var(--funnelfork-accent); outline-offset: 2px; } &:active { transform: scale(0.99); } &.is-selected { border-color: var(--funnelfork-accent); background: color-mix(in srgb, var(--funnelfork-accent) 10%, transparent); } } .is-yesno .funnelfork__answer { justify-content: center; text-align: center; font-weight: 600; padding-block: 1.25rem; } .funnelfork__subtitle { margin: var(--funnelfork-gap) 0 0.75rem; font-size: 1.1em; } .funnelfork__score { display: inline-block; margin: 0 0 var(--funnelfork-gap); padding: 0.35rem 0.9rem; border-radius: 999px; background: var(--funnelfork-surface); border: 1px solid var(--funnelfork-border); font-weight: 600; } .funnelfork__advice, .funnelfork__summary { margin-top: var(--funnelfork-gap); padding: 1.25rem; border-radius: var(--funnelfork-radius); background: var(--funnelfork-surface); border: 1px solid var(--funnelfork-border); .funnelfork__subtitle { margin-top: 0; } } .funnelfork__labels { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; } .funnelfork__label { display: flex; gap: 0.75rem; align-items: flex-start; margin: 0; } .funnelfork__label-dot { flex-shrink: 0; width: 0.85rem; height: 0.85rem; margin-top: 0.3em; border-radius: 50%; } .funnelfork__label-description { margin: 0.15rem 0 0; color: var(--funnelfork-muted); font-size: 0.95em; } .funnelfork__summary-list { margin: 0; dt { font-weight: 600; margin-top: 0.6rem; &:first-child { margin-top: 0; } } dd { margin: 0.1rem 0 0; color: var(--funnelfork-muted); } } .funnelfork__restart { margin-top: var(--funnelfork-gap); background: none; border: 0; padding: 0; color: inherit; font: inherit; font-size: 0.9em; text-decoration: underline; cursor: pointer; opacity: 0.75; &:hover { opacity: 1; } } .funnelfork__sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* Preview page */ .funnelfork-preview__main { padding: 4rem 1.5rem; box-sizing: border-box; } @media (max-width: 480px) { .is-yesno .funnelfork__answers { grid-template-columns: 1fr; } } @media (prefers-reduced-motion: reduce) { .funnelfork__slide, .funnelfork__viewport, .funnelfork__progress-bar { transition: none; } }