Skip to content

Commit 4fd37f1

Browse files
authored
feat(core, react): css scoping
2 parents d2cfa76 + 181be08 commit 4fd37f1

39 files changed

Lines changed: 1026 additions & 200 deletions

docs-site/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import OrganizationDetailsEditDocs from './pages/OrganizationDetailsEditDocs';
1010
import SsoProviderCreateDocs from './pages/SsoProviderCreateDocs';
1111
import SsoProviderEditDocs from './pages/SsoProviderEditDocs';
1212
import SsoProviderTableDocs from './pages/SsoProviderTableDocs';
13+
import Styling from './pages/Styling';
1314
import UserMFAMgmtDocs from './pages/UserMFAMgmtDocs';
1415

1516
function AppContent() {
@@ -18,6 +19,7 @@ function AppContent() {
1819
<Routes>
1920
<Route path="/" element={<GettingStarted />} />
2021
<Route path="/getting-started" element={<GettingStarted />} />
22+
<Route path="/styling" element={<Styling />} />
2123
<Route path="/my-account" element={<MyAccountIntroduction />} />
2224
<Route path="/my-account/user-mfa-management" element={<UserMFAMgmtDocs />} />
2325
<Route path="/my-organization" element={<MyOrganizationIntroduction />} />

docs-site/src/components/Layout.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
Zap,
99
Github,
1010
BookOpenText,
11+
Palette,
1112
} from 'lucide-react';
1213
import type { ReactNode } from 'react';
1314
import { Link, useLocation } from 'react-router-dom';
@@ -68,6 +69,12 @@ export default function Layout({ children }: LayoutProps) {
6869
color: 'text-purple-500',
6970
href: '/',
7071
},
72+
{
73+
title: 'Styling',
74+
icon: Palette,
75+
color: 'text-violet-500',
76+
href: '/styling',
77+
},
7178
{
7279
title: 'My Account',
7380
icon: User,

docs-site/src/pages/GettingStarted.tsx

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,80 @@ export default function OrganizationManagementPage() {
592592
)}
593593
</section>
594594

595+
{/* Styling */}
596+
<section className="space-y-6">
597+
<h2 className="text-2xl font-semibold text-gray-900">Styling</h2>
598+
<p className="text-gray-600">
599+
The package ships two stylesheets. Pick the one that matches how your application handles
600+
CSS.
601+
</p>
602+
603+
<div className="grid md:grid-cols-2 gap-6">
604+
<div className="bg-white border border-gray-200 rounded-lg p-6 space-y-3">
605+
<div className="flex items-center gap-2">
606+
<span className="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-violet-100 text-violet-800">
607+
Recommended
608+
</span>
609+
</div>
610+
<h3 className="text-lg font-semibold text-gray-900">
611+
<code className="text-sm bg-gray-100 px-2 py-1 rounded">styles.css</code>
612+
</h3>
613+
<p className="text-gray-600 text-sm">
614+
A self-contained stylesheet with all Tailwind utilities pre-compiled and scoped to
615+
Auth0 components. No Tailwind installation required.
616+
</p>
617+
<CodeBlock code={`import '@auth0/universal-components-react/styles';`} language="tsx" />
618+
</div>
619+
620+
<div className="bg-white border border-gray-200 rounded-lg p-6 space-y-3">
621+
<div className="flex items-center gap-2">
622+
<span className="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800">
623+
Tailwind apps
624+
</span>
625+
</div>
626+
<h3 className="text-lg font-semibold text-gray-900">Tailwind v4 theme variables</h3>
627+
<p className="text-gray-600 text-sm">
628+
If your app already uses Tailwind v4, import the Auth0 CSS alongside Tailwind and
629+
define standard design tokens in your <code className="text-xs">:root</code> /{' '}
630+
<code className="text-xs">.dark</code> blocks (e.g.{' '}
631+
<code className="text-xs">--background</code>,{' '}
632+
<code className="text-xs">--primary</code>).
633+
</p>
634+
<CodeBlock
635+
code={`/* app.css */
636+
@import "tailwindcss";
637+
@import "@auth0/universal-components-react/tailwind";
638+
639+
:root {
640+
--background: oklch(1 0 0);
641+
--primary: oklch(0.205 0 0);
642+
/* ... see Styling page for full list */
643+
}`}
644+
language="css"
645+
/>
646+
</div>
647+
</div>
648+
649+
<div className="bg-blue-50 border border-blue-200 rounded-lg p-4">
650+
<p className="text-sm text-blue-800">
651+
<strong>When to use which:</strong> If your app does not use Tailwind, import{' '}
652+
<code className="text-xs">styles.css</code> — it is self-contained and works without
653+
Tailwind. If your app uses Tailwind v4, import{' '}
654+
<code className="text-xs">@auth0/universal-components-react/tailwind</code> and define
655+
the standard tokens in your <code className="text-xs">:root</code> /{' '}
656+
<code className="text-xs">.dark</code> blocks instead.
657+
</p>
658+
</div>
659+
660+
<p className="text-gray-600">
661+
For full details on CSS variables, theming, and color modes, see the{' '}
662+
<a href="/styling" className="text-blue-600 hover:underline font-medium">
663+
Styling &amp; Theming
664+
</a>{' '}
665+
page.
666+
</p>
667+
</section>
668+
595669
{/* Provider Configuration */}
596670
<section className="space-y-6">
597671
<h2 className="text-2xl font-semibold text-gray-900">

0 commit comments

Comments
 (0)