Files
dictia-public/static/css/tailwind.config.js
Allison 3b324ad0b9 fix(auth): B-2.2 review fixes — Tailwind path + WCAG + race + flash + tests
C-1: Add templates/register.html (and templates/auth/**) to tailwind.config.js
content array so utility classes used by the signup template don't get purged
on next build. Rebuilt static/css/marketing.css; verified text-brand-navy/90
and min-h-[calc(100vh-62px)] are now compiled.

I-1: Replace flash() calls for missing required consents with WTForms
field-level errors (form.consent_cgu.errors.append / form.consent_confidentialite
.errors.append). Errors render inline next to each consent checkbox via
{% if form.consent_cgu.errors %}<p role="alert">…</p>{% endif %}. Prevents
session-backed flash messages from leaking across unrelated navigations.

I-2: Wrap user creation + flush in IntegrityError retry loop (max 5 attempts);
import IntegrityError from sqlalchemy.exc. Absorbs the inherent race between
_generate_unique_username's lookup and the subsequent flush under concurrent
signups. Added docstring note to _generate_unique_username explaining the
wrapper.

I-3: Move db.create_all() inside the try/finally in
test_signup_route_csrf_enforced so WTF_CSRF_ENABLED is restored even if
table creation fails.

I-4: Pin test_signup_rejects_duplicate_email assertion to status_code == 200
(WTForms validate_email raises ValidationError → form fails validation →
fall-through to default 200 render_template).

I-5: Add id="password-help" to the password help paragraph and
aria-describedby="password-help" to the password input so screen readers
announce the password requirements when the field is focused.

I-6: Bump flash banner text colors from -700/-800 to -900 variants
(text-amber-900, text-blue-900, text-red-900, text-green-900) for safer
WCAG 2.2 AA contrast against the -50 backgrounds. Same bump applied to the
new consent and password inline error renders.
2026-04-27 22:43:00 -04:00

66 lines
2.3 KiB
JavaScript

/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./templates/marketing/**/*.html', './templates/legal/**/*.html', './templates/billing/**/*.html', './templates/macros/**/*.html', './templates/auth/**/*.html', './templates/register.html', './src/marketing/**/*.py', './src/legal/**/*.py', './src/billing/**/*.py'],
darkMode: 'class',
theme: {
extend: {
colors: {
brand: {
b1: '#0062ff',
b2: '#00bdd8',
b3: '#00c896',
navy: '#060d1a',
navy2: '#0b1525',
navy3: '#0f1e35',
bg: '#f7f9fc',
border: '#e6ebf2',
},
},
fontFamily: {
sans: ['Inter Variable', 'Inter', 'system-ui', 'sans-serif'],
mono: ['JetBrains Mono Variable', 'JetBrains Mono', 'monospace'],
},
backgroundImage: {
'brand-grad': 'linear-gradient(118deg, #0062ff, #00bdd8 52%, #00c896)',
},
boxShadow: {
'cta': '0 4px 20px rgba(0, 98, 255, 0.28)',
'cta-hover': '0 8px 32px rgba(0, 98, 255, 0.42)',
},
borderRadius: {
DEFAULT: '0.75rem',
},
keyframes: {
'tc-fade-in-up': {
'0%': { opacity: '0', transform: 'translateY(16px)' },
'100%': { opacity: '1', transform: 'translateY(0)' },
},
'tc-fade-in-right': {
'0%': { opacity: '0', transform: 'translateX(-16px)' },
'100%': { opacity: '1', transform: 'translateX(0)' },
},
'tc-float-y': {
'0%, 100%': { transform: 'translateY(0)' },
'50%': { transform: 'translateY(-8px)' },
},
'tc-pulse-glow': {
'0%, 100%': { boxShadow: '0 4px 20px rgba(0, 98, 255, 0.28)' },
'50%': { boxShadow: '0 8px 32px rgba(0, 98, 255, 0.42)' },
},
'plus-breathe': {
'0%, 100%': { transform: 'scale(1)' },
'50%': { transform: 'scale(1.05)' },
},
},
animation: {
'tc-fade-in-up': 'tc-fade-in-up 600ms ease-out forwards',
'tc-fade-in-right': 'tc-fade-in-right 600ms ease-out forwards',
'tc-float-y': 'tc-float-y 4s ease-in-out infinite',
'tc-pulse-glow': 'tc-pulse-glow 3s ease-in-out infinite',
'plus-breathe': 'plus-breathe 2s ease-in-out infinite',
},
},
},
plugins: [],
}