Files
library/apps/frontend/src/styles.scss
T
hikari 7d8c6bf21c
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m42s
Node.js CI / CI (push) Successful in 1m47s
fix: load Google Fonts correctly with strict CSP (#77)
## Summary

- Allows `fonts.googleapis.com` in `style-src` and `fonts.gstatic.com` in `font-src` so the browser can load Google Fonts
- Adds preconnect hints and the Google Fonts import (Griffy, Kalam, Creepster, Henny Penny) to `index.html`
- Sets the body font to Kalam and heading font to Griffy, with utility classes for Creepster and Henny Penny
- Disables Angular's `inlineCritical` optimisation, which was causing the stylesheet to be deferred via `onload="this.media='all'"` — an inline event handler blocked by the strict `script-src` CSP, preventing the heading font rules from ever applying to screen media

## Test plan

- [ ] Rebuild and reload the app
- [ ] Verify headings render in Griffy
- [ ] Verify body text renders in Kalam
- [ ] Check DevTools Styles tab confirms the `h1-h6` font-family rule is matched

 This PR was created with help from Hikari~ 🌸

Reviewed-on: #77
Co-authored-by: Hikari <hikari@nhcarrigan.com>
Co-committed-by: Hikari <hikari@nhcarrigan.com>
2026-03-05 10:32:19 -08:00

252 lines
4.7 KiB
SCSS

/* You can add global styles to this file, and also import other style files */
:root {
/* Witchy Purple Rose Palette */
--witch-purple: #2B1B3D;
--witch-plum: #44275A;
--witch-rose: #A8577E;
--witch-mauve: #D4A5C7;
--witch-lavender: #E8D5E8;
--witch-black: #0A0009;
--witch-silver: #C0C0C0;
--witch-moon: #F5F5F5;
--witch-shadow: rgba(10, 0, 9, 0.7);
/* Theme variables */
--foreground: var(--witch-purple);
--background: var(--witch-moon);
--accent: var(--witch-rose);
--border: var(--witch-plum);
--highlight: var(--witch-mauve);
/* Additional variables for components */
--primary-color: var(--witch-rose);
--border-color: var(--witch-plum);
--hover-background: var(--witch-lavender);
--text-color: var(--witch-purple);
--primary-light-background: rgba(168, 87, 126, 0.1);
font-size: 14pt;
line-height: 1.6;
}
// Reset and base styles
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
font-family: 'Kalam', cursive;
font-size: 14pt;
line-height: 1.6;
color: var(--foreground);
background-color: var(--background);
position: relative;
min-height: 100vh;
}
/* Witchy mystical background */
body::before {
content: "";
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: url(https://cdn.nhcarrigan.com/background.png);
background-size: cover;
background-position: center;
z-index: -2;
pointer-events: none;
}
/* Semi-transparent overlay for readability */
body::after {
content: "";
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(245, 245, 245, 0.9);
z-index: -1;
pointer-events: none;
}
@keyframes wiggle {
0%, 100% { transform: rotate(-2deg); }
50% { transform: rotate(2deg); }
}
h1, h2, h3, h4, h5, h6 {
margin-top: 0;
line-height: 1.2;
color: var(--witch-purple);
font-family: 'Griffy', cursive;
}
h1 {
animation: wiggle 4s ease-in-out infinite;
display: inline-block;
}
.witchy-accent,
.spooky-title {
font-family: 'Creepster', cursive;
}
.mystical-text {
font-family: 'Henny Penny', cursive;
}
a {
color: var(--witch-rose);
text-decoration: none;
transition: color 0.3s;
}
a:hover {
color: var(--witch-plum);
text-decoration: underline;
}
// Utility classes
.container {
width: 100%;
max-width: 1200px;
margin: 0 auto;
padding: 0 1rem;
}
// Form styles
input,
textarea,
select {
font-family: inherit;
font-size: inherit;
background-color: var(--witch-moon);
border: 2px solid var(--witch-mauve);
color: var(--witch-purple);
transition: border-color 0.3s;
}
input:focus,
textarea:focus,
select:focus {
outline: none;
border-color: var(--witch-rose);
}
// Button base styles
button {
font-family: inherit;
transition: all 0.3s;
}
// Scrollbar styling
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
::-webkit-scrollbar-track {
background: var(--witch-lavender);
}
::-webkit-scrollbar-thumb {
background: var(--witch-rose);
border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--witch-plum);
}
// Skip to main content link - visually hidden but accessible to screen readers
.skip-link {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
.skip-link:focus {
position: fixed;
top: 0;
left: 0;
width: auto;
height: auto;
padding: 0.75rem 1.5rem;
margin: 0;
overflow: visible;
clip: auto;
white-space: normal;
background: var(--witch-rose);
color: var(--witch-moon);
text-decoration: none;
font-weight: 600;
border-radius: 0 0 4px 0;
z-index: 10000;
}
// Enhanced focus styles for keyboard navigation
*:focus-visible {
outline: 3px solid var(--witch-rose);
outline-offset: 2px;
border-radius: 2px;
}
// Remove default focus outline when focus-visible is used
*:focus:not(:focus-visible) {
outline: none;
}
// Button focus styles
button:focus-visible {
outline: 3px solid var(--witch-rose);
outline-offset: 2px;
}
// Link focus styles
a:focus-visible {
outline: 3px solid var(--witch-rose);
outline-offset: 2px;
text-decoration: underline;
}
// Form input focus styles
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
outline: 3px solid var(--witch-rose);
outline-offset: 2px;
border-color: var(--witch-rose);
}
// Ensure sufficient contrast for focus indicators
@media (prefers-contrast: high) {
*:focus-visible {
outline-width: 4px;
outline-offset: 3px;
}
}
// Reduced motion preferences
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}