Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

init widget

Jonathan Summers-Muire7388d4f89a3
diff --git a/apps/www/components/AuthWidget/AuthComponentExample.tsx b/apps/www/components/AuthWidget/AuthComponentExample.tsx
index b345a1d3208..e2bf386e978 100644
--- a/apps/www/components/AuthWidget/AuthComponentExample.tsx
+++ b/apps/www/components/AuthWidget/AuthComponentExample.tsx
@@ -1,23 +1,15 @@
-import { useEffect, useState } from 'react'
import { createClient } from '@supabase/supabase-js'
-import {
- Badge,
- Button,
- Card,
- // Auth,
- Space,
- Tabs,
- IconCode,
- IconSearch,
-} from '@supabase/ui'
+import { Button, IconCode, IconSearch, Tabs } from '@supabase/ui'
+import { useState } from 'react'
import CodeBlock from '../CodeBlock/CodeBlock'
// Import Swiper React components
-import { Swiper, SwiperSlide } from 'swiper/react'
-import Link from 'next/link'
import { useRouter } from 'next/router'
import { useTheme } from '../Providers'
+import { Auth, ThemeSupa } from '@supabase/auth-ui-react'
+import { ColorSwatchIcon } from '@heroicons/react/outline'
+
const supabase = createClient(
'https://rsnibhkhsbfnncjmwnkj.supabase.co',
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYxNTIxNDE1MywiZXhwIjoxOTMwNzkwMTUzfQ.OQEbAaTfgDdLCCht251P2JRD3QDnui6nsU8N-tZA_Mc'
@@ -26,36 +18,37 @@ const supabase = createClient(
function AuthComponentExample() {
const { isDarkMode } = useTheme()
const { basePath } = useRouter()
+ const [theme, setTheme] = useState('default')
// // store API swiper instance
- // const [imageSwiper, setImageSwiper] = useState(undefined)
- // const [imageSwiperActiveIndex, setImageSwiperActiveIndex] = useState(0)
-
- // function handleNavChange(e: number) {
- // console.log(e)
- // setImageSwiperActiveIndex(e)
- // // @ts-ignore
- // imageSwiper.slideTo(e)
- // }
-
- // const AuthContainer = (props: any) => {
- // const { user } = Auth.useUser()
- // if (user) {
- // return (
- // <>
- // <p>Signed in: {user.email}</p>
- // <Button block onClick={() => props.supabaseClient.auth.signOut()}>
- // Sign out
- // </Button>
- // </>
- // )
- // }
- // return props.children
- // }
+ const [imageSwiper, setImageSwiper] = useState(undefined)
+ const [imageSwiperActiveIndex, setImageSwiperActiveIndex] = useState(0)
+
+ function handleNavChange(e: number) {
+ console.log(e)
+ setImageSwiperActiveIndex(e)
+ // @ts-ignore
+ imageSwiper.slideTo(e)
+ }
+
+ const AuthContainer = (props: any) => {
+ const { user } = Auth.useUser()
+ if (user) {
+ return (
+ <>
+ <p>Signed in: {user.email}</p>
+ <Button block onClick={() => props.supabaseClient.auth.signOut()}>
+ Sign out
+ </Button>
+ </>
+ )
+ }
+ return props.children
+ }
return (
<div className="sbui-tabs--alt">
- {/* <Tabs
+ <Tabs
activeId={imageSwiperActiveIndex.toString()}
onChange={(id: string) => handleNavChange(Number(id))}
>
@@ -65,146 +58,69 @@ function AuthComponentExample() {
<Tabs.Panel label="Code" icon={<IconCode />} id="1">
<span></span>
</Tabs.Panel>
- </Tabs> */}
- <div
- className={`auth-container relative border bg-white py-2 pb-16 dark:border-gray-600 dark:bg-gray-800`}
- >
- <Swiper
- // @ts-ignore
- onSwiper={setImageSwiper}
- style={{ zIndex: 0 }}
- initialSlide={0}
- spaceBetween={0}
- slidesPerView={1}
- speed={300}
- autoHeight={true}
- allowTouchMove={false}
- >
- <SwiperSlide key={1}>
- <div className="pt-8" style={{ maxWidth: '420px', margin: '0 auto' }}>
- <Card>
- <Space size={4} direction="vertical">
- <div>
- <Space size={3} direction="vertical">
- <img
- src={
- isDarkMode
- ? `${basePath}/brand-assets/supabase-logo-wordmark--dark.svg`
- : `${basePath}/brand-assets/supabase-logo-wordmark--light.svg`
- }
- width="96"
- alt="Logo"
- />
- <h3>{'Acme Company'}</h3>
- </Space>
- <Badge dot>Demo</Badge>
- </div>
- <p>Sign in with</p>
- <div className="flex justify-evenly">
- <Link href="https://supabase.com/docs/guides/auth/auth-facebook">
- <Button type="default" size="large">
- <svg
- aria-hidden="true"
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 448 512"
- width="24"
- height="24"
- >
- <path
- fill="currentColor"
- d="M400 32H48A48 48 0 0 0 0 80v352a48 48 0 0 0 48 48h137.25V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.27c-30.81 0-40.42 19.12-40.42 38.73V256h68.78l-11 71.69h-57.78V480H400a48 48 0 0 0 48-48V80a48 48 0 0 0-48-48z"
- ></path>
- </svg>
- </Button>
- </Link>
-
- <Link href="https://supabase.com/docs/guides/auth/auth-google">
- <Button type="default" size="large">
- <svg
- aria-hidden="true"
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 488 512"
- width="22"
- height="22"
- >
- <path
- fill="currentColor"
- d="M488 261.8C488 403.3 391.1 504 248 504 110.8 504 0 393.2 0 256S110.8 8 248 8c66.8 0 123 24.5 166.3 64.9l-67.5 64.9C258.5 52.6 94.3 116.6 94.3 256c0 86.5 69.1 156.6 153.7 156.6 98.2 0 135-70.4 140.8-106.9H248v-85.3h236.1c2.3 12.7 3.9 24.9 3.9 41.4z"
- ></path>
- </svg>
- </Button>
- </Link>
-
- <Link href="https://supabase.com/docs/guides/auth/auth-github">
- <Button type="default" size="large">
- <svg
- aria-hidden="true"
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 256 249"
- width="22"
- height="22"
- >
- <g fill="currentColor">
- <path d="M127.505 0C57.095 0 0 57.085 0 127.505c0 56.336 36.534 104.13 87.196 120.99 6.372 1.18 8.712-2.766 8.712-6.134 0-3.04-.119-13.085-.173-23.739-35.473 7.713-42.958-15.044-42.958-15.044-5.8-14.738-14.157-18.656-14.157-18.656-11.568-7.914.872-7.752.872-7.752 12.804.9 19.546 13.14 19.546 13.14 11.372 19.493 29.828 13.857 37.104 10.6 1.144-8.242 4.449-13.866 8.095-17.05-28.32-3.225-58.092-14.158-58.092-63.014 0-13.92 4.981-25.295 13.138-34.224-1.324-3.212-5.688-16.18 1.235-33.743 0 0 10.707-3.427 35.073 13.07 10.17-2.826 21.078-4.242 31.914-4.29 10.836.048 21.752 1.464 31.942 4.29 24.337-16.497 35.029-13.07 35.029-13.07 6.94 17.563 2.574 30.531 1.25 33.743 8.175 8.929 13.122 20.303 13.122 34.224 0 48.972-29.828 59.756-58.22 62.912 4.573 3.957 8.648 11.717 8.648 23.612 0 17.06-.148 30.791-.148 34.991 0 3.393 2.295 7.369 8.759 6.117 50.634-16.879 87.122-64.656 87.122-120.973C255.009 57.085 197.922 0 127.505 0" />
- <path d="M47.755 181.634c-.28.633-1.278.823-2.185.389-.925-.416-1.445-1.28-1.145-1.916.275-.652 1.273-.834 2.196-.396.927.415 1.455 1.287 1.134 1.923M54.027 187.23c-.608.564-1.797.302-2.604-.589-.834-.889-.99-2.077-.373-2.65.627-.563 1.78-.3 2.616.59.834.899.996 2.08.36 2.65M58.33 194.39c-.782.543-2.06.034-2.849-1.1-.781-1.133-.781-2.493.017-3.038.792-.545 2.05-.055 2.85 1.07.78 1.153.78 2.513-.019 3.069M65.606 202.683c-.699.77-2.187.564-3.277-.488-1.114-1.028-1.425-2.487-.724-3.258.707-.772 2.204-.555 3.302.488 1.107 1.026 1.445 2.496.7 3.258M75.01 205.483c-.307.998-1.741 1.452-3.185 1.028-1.442-.437-2.386-1.607-2.095-2.616.3-1.005 1.74-1.478 3.195-1.024 1.44.435 2.386 1.596 2.086 2.612M85.714 206.67c.036 1.052-1.189 1.924-2.705 1.943-1.525.033-2.758-.818-2.774-1.852 0-1.062 1.197-1.926 2.721-1.951 1.516-.03 2.758.815 2.758 1.86M96.228 206.267c.182 1.026-.872 2.08-2.377 2.36-1.48.27-2.85-.363-3.039-1.38-.184-1.052.89-2.105 2.367-2.378 1.508-.262 2.857.355 3.049 1.398" />
- </g>
- </svg>
- </Button>
- </Link>
-
- <Link href="https://supabase.com/docs/guides/auth/auth-bitbucket">
- <Button type="default" size="large">
- <svg
- aria-hidden="true"
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 512 512"
- width="22"
- height="22"
- >
- <path
- fill="currentColor"
- d="M22.2 32A16 16 0 0 0 6 47.8a26.35 26.35 0 0 0 .2 2.8l67.9 412.1a21.77 21.77 0 0 0 21.3 18.2h325.7a16 16 0 0 0 16-13.4L505 50.7a16 16 0 0 0-13.2-18.3 24.58 24.58 0 0 0-2.8-.2L22.2 32zm285.9 297.8h-104l-28.1-147h157.3l-25.2 147z"
- ></path>
- </svg>
- </Button>
- </Link>
-
- <Link href="https://supabase.com/docs/guides/auth/auth-gitlab">
- <Button type="default" size="large">
- <svg
- aria-hidden="true"
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 512 512"
- width="22"
- height="22"
- >
- <path
- fill="currentColor"
- d="M105.2 24.9c-3.1-8.9-15.7-8.9-18.9 0L29.8 199.7h132c-.1 0-56.6-174.8-56.6-174.8zM.9 287.7c-2.6 8 .3 16.9 7.1 22l247.9 184-226.2-294zm160.8-88l94.3 294 94.3-294zm349.4 88l-28.8-88-226.3 294 247.9-184c6.9-5.1 9.7-14 7.2-22zM425.7 24.9c-3.1-8.9-15.7-8.9-18.9 0l-56.6 174.8h132z"
- ></path>
- </svg>
- </Button>
- </Link>
- </div>
- <div className="flex w-full flex-row items-center justify-center">
- <div className="h-[1px] w-full bg-gray-500" />
- <p className="w-full text-center text-gray-500">or continue with</p>
- <div className="h-[1px] w-full bg-gray-500" />
- </div>
- {/* <Auth.UserContextProvider supabaseClient={supabase}>
- <AuthContainer supabaseClient={supabase}>
- <Auth supabaseClient={supabase} />
- </AuthContainer>
- </Auth.UserContextProvider> */}
- </Space>
- </Card>
+ </Tabs>
+
+ {/* Controls */}
+ <Button type="default" onClick={() => setTheme('dark')}>
+ Dark
+ </Button>
+ <Button type="default" onClick={() => setTheme('default')}>
+ Light
+ </Button>
+
+ <div className={`auth-container dark:bg-scale-100 relative border bg-white py-2 pb-16`}>
+ <div className="dark:bg-scale-300 border-scale-500 m-12 mx-auto max-w-md rounded-xl border bg-white py-8 px-8 drop-shadow-md">
+ <div className="mb-6">
+ <div className="text-scale-1100 w-8">
+ <ColorSwatchIcon strokeWidth={1.5} />
</div>
- </SwiperSlide>
+ <h1 className="text-auth-widget-input text-2xl">Acne Ltd</h1>
+ </div>
+ <p className="text-auth-widget-test">Sign in today for Supa stuff</p>
+ <Auth.UserContextProvider supabaseClient={supabase}>
+ <AuthContainer supabaseClient={supabase}>
+ <Auth
+ theme={theme}
+ providers={['google', 'facebook', 'twitter']}
+ supabaseClient={supabase}
+ appearance={{ theme: ThemeSupa }}
+ socialLayout="horizontal"
+ />
+ </AuthContainer>
+ </Auth.UserContextProvider>
+ </div>
+ </div>
- <SwiperSlide key={2}>
- <div className="p-8">
- <CodeBlock
- children={`import React, { useState } from 'react'
+ {/* <div className={theme === 'dark' ? 'dark' : 'all-unset'}>
+ <div
+ className={`auth-container dark:bg-scale-100 relative border bg-white py-2 pb-16 dark:border-gray-600`}
+ >
+ <div className="pt-8" style={{ maxWidth: '420px', margin: '0 auto' }}>
+ <div className="dark:bg-scale-400 border-scale-700 rounded-xl border bg-white py-8 px-8 drop-shadow-md">
+ <div className="mb-6">
+ <div className="text-scale-1100 w-8">
+ <ColorSwatchIcon strokeWidth={1.5} />
+ </div>
+ <h1 className="text-auth-widget-input text-2xl">Acne Ltd</h1>
+ </div>
+ <p className="text-auth-widget-test">Sign in today for Supa stuff</p>
+ <Auth.UserContextProvider supabaseClient={supabase}>
+ <AuthContainer supabaseClient={supabase}>
+ <Auth
+ theme={theme}
+ providers={['google', 'facebook', 'twitter']}
+ supabaseClient={supabase}
+ appearance={{ theme: ThemeSupa }}
+ socialLayout="horizontal"
+ />
+ </AuthContainer>
+ </Auth.UserContextProvider>
+ </div>
+ </div>
+ </div>
+ </div> */}
+ <CodeBlock
+ children={`import React, { useState } from 'react'
import { Auth, Button } from '@supabase/ui'
import { createClient } from '@supabase/supabase-js'
@@ -238,12 +154,8 @@ export default function app() {
);
}
`}
- lang="js"
- />
- </div>
- </SwiperSlide>
- </Swiper>
- </div>
+ lang="js"
+ />
</div>
)
}
diff --git a/apps/www/components/AuthWidget/AuthWidgetSection.tsx b/apps/www/components/AuthWidget/AuthWidgetSection.tsx
new file mode 100644
index 00000000000..dc8a3d9d176
--- /dev/null
+++ b/apps/www/components/AuthWidget/AuthWidgetSection.tsx
@@ -0,0 +1,293 @@
+import { createClient } from '@supabase/supabase-js'
+import { Button, IconArrowUpRight, IconCode, IconSearch, IconX, Radio, Tabs } from '@supabase/ui'
+import { useState } from 'react'
+import CodeBlock from '../CodeBlock/CodeBlock'
+// Import Swiper React components
+import { useRouter } from 'next/router'
+
+import { useTheme } from '../Providers'
+import Solutions from 'data/Solutions.json'
+import { Auth, ThemeSupa } from '@supabase/auth-ui-react'
+import { ArrowNarrowUpIcon, ColorSwatchIcon, MenuIcon } from '@heroicons/react/outline'
+import ProductIcon from '../ProductIcon'
+import Link from 'next/link'
+
+const supabase = createClient(
+ 'https://rsnibhkhsbfnncjmwnkj.supabase.co',
+ 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYxNTIxNDE1MywiZXhwIjoxOTMwNzkwMTUzfQ.OQEbAaTfgDdLCCht251P2JRD3QDnui6nsU8N-tZA_Mc'
+)
+
+function AuthWidgetSection() {
+ const { isDarkMode } = useTheme()
+ const { basePath } = useRouter()
+ const [theme, setTheme] = useState('default')
+
+ const [radius, setRadius] = useState('4px')
+ const [brandColor, setBrandColor] = useState({
+ brand: 'var(--colors-brand9)',
+ brandAccent: 'var(--colors-brand11)',
+ brandAccent2: 'var(--colors-brand3)',
+ })
+ const [layout, setLayout] = useState('horizontal')
+
+ // // store API swiper instance
+ const [imageSwiper, setImageSwiper] = useState(undefined)
+ const [imageSwiperActiveIndex, setImageSwiperActiveIndex] = useState(0)
+
+ function handleNavChange(e: number) {
+ console.log(e)
+ setImageSwiperActiveIndex(e)
+ // @ts-ignore
+ imageSwiper.slideTo(e)
+ }
+
+ const AuthContainer = (props: any) => {
+ const { user } = Auth.useUser()
+ if (user) {
+ return (
+ <>
+ <p>Signed in: {user.email}</p>
+ <Button block onClick={() => props.supabaseClient.auth.signOut()}>
+ Sign out
+ </Button>
+ </>
+ )
+ }
+ return props.children
+ }
+
+ // rounded-xl rounded-3xl rounded-full // for purging
+
+ return (
+ <div className="sbui-tabs--alt overflow-hidden">
+ <div className={`dark:bg-scale-200 bg-scale-100 relative border py-2 pb-16`}>
+ <div className="sm:py-18 container relative mx-auto grid grid-cols-2 gap-32 px-6 py-16 md:py-24 lg:px-16 lg:py-24 xl:px-20">
+ <div className="relative z-10 col-span-1">
+ <div className="relative mx-auto max-w-md">
+ <div className="glow-area transition-all"></div>
+
+ <div className="border-scale-400 dark:bg-scale-300 pointer-events-none relative rounded-xl border bg-white px-8 py-12 drop-shadow-sm">
+ <div className="mb-6 flex flex-col gap-6">
+ <div className="flex items-center gap-3">
+ <div
+ className="w-10 rounded-full p-2"
+ style={{
+ background: brandColor.brandAccent2,
+ color: brandColor.brand,
+ }}
+ >
+ <ColorSwatchIcon strokeWidth={1.5} />
+ </div>
+ <h1 className="text-scale-1200 text-2xl">Acne Company Ltd</h1>
+ </div>
+ <p className="text-scale-1100 text-auth-widget-test">
+ Sign in today for Supa stuff
+ </p>
+ </div>
+ <Auth.UserContextProvider supabaseClient={supabase}>
+ <AuthContainer supabaseClient={supabase}>
+ <Auth
+ socialLayout={layout}
+ theme={isDarkMode ? 'dark' : 'default'}
+ providers={['google', 'facebook', 'twitter']}
+ supabaseClient={supabase}
+ localization={{
+ lang: 'ja',
+ }}
+ appearance={{
+ theme: ThemeSupa,
+ variables: {
+ default: {
+ colors: {
+ brand: brandColor.brand,
+ brandAccent: brandColor.brandAccent,
+ },
+ radii: {
+ borderRadiusButton: radius,
+ buttonBorderRadius: radius,
+ inputBorderRadius: radius,
+ },
+ },
+ },
+ }}
+ />
+ </AuthContainer>
+ </Auth.UserContextProvider>
+ </div>
+ </div>
+ </div>
+ <div>
+ <div className="mb-4 flex items-center space-x-2">
+ <div className="flex h-8 w-8 items-center justify-center rounded-md bg-gray-900 text-white dark:bg-white dark:text-gray-900">
+ <ProductIcon icon={Solutions['authentication'].icon} />
+ </div>
+ <p className="text-scale-900 m-0">
+ <IconX />
+ </p>
+ <img className="w-8" src={`${basePath}/images/product/auth/react-icon.svg`} />
+ </div>
+
+ <div className="prose !max-w-md">
+ <h3 className="">Auth UI</h3>
+ <p className="!mb-0">Pre-built auth widgets to get started in minutes.</p>
+ <p className="text-scale-900 mt-0">
+ Supabase provides React libraries which handle common scenarios, including logging
+ in, signing up, magic link and forgot password forms.
+ </p>
+ </div>
+
+ <div className="grid grid-cols-2 gap-8 py-8">
+ <div className="flex flex-col gap-2">
+ <label className="text-scale-1200 text-base">Brand color</label>
+ <div className="flex items-center gap-3">
+ <button
+ onClick={() =>
+ setBrandColor({
+ brand: 'var(--colors-brand9)',
+ brandAccent: 'var(--colors-brand11)',
+ brandAccent2: 'var(--colors-brand3)',
+ })
+ }
+ className={[
+ 'bg-brand-300 border-brand-900 h-10 w-10 rounded-full border-2 transition hover:scale-105',
+ brandColor.brand === 'var(--colors-brand9)'
+ ? ' !bg-brand-900 ring-scale-400 border-scale-800 ring-2 drop-shadow-lg dark:ring-white'
+ : '',
+ ].join(' ')}
+ ></button>
+ <button
+ onClick={() =>
+ setBrandColor({
+ brand: 'var(--colors-orange9)',
+ brandAccent: 'var(--colors-orange11)',
+ brandAccent2: 'var(--colors-orange3)',
+ })
+ }
+ className={[
+ 'h-10 w-10 rounded-full border-2 border-orange-900 bg-orange-300 transition hover:scale-105 ',
+ brandColor.brand === 'var(--colors-orange9)'
+ ? ' ring-scale-400 border-scale-800 !bg-orange-900 ring-2 drop-shadow-lg dark:ring-white'
+ : '',
+ ].join(' ')}
+ ></button>
+ <button
+ onClick={() =>
+ setBrandColor({
+ brand: 'var(--colors-crimson9)',
+ brandAccent: 'var(--colors-crimson11)',
+ brandAccent2: 'var(--colors-crimson3)',
+ })
+ }
+ className={[
+ 'border-crimson-900 bg-crimson-300 h-10 w-10 rounded-full border-2 transition hover:scale-105 ',
+ brandColor.brand === 'var(--colors-crimson9)'
+ ? ' ring-scale-400 border-scale-800 !bg-crimson-900 ring-2 drop-shadow-lg dark:ring-white'
+ : '',
+ ].join(' ')}
+ ></button>
+ <button
+ onClick={() =>
+ setBrandColor({
+ brand: 'var(--colors-indigo9)',
+ brandAccent: 'var(--colors-indigo11)',
+ brandAccent2: 'var(--colors-indigo3)',
+ })
+ }
+ className={[
+ 'h-10 w-10 rounded-full border-2 border-indigo-900 bg-indigo-300 transition hover:scale-105 ',
+ brandColor.brand === 'var(--colors-indigo9)'
+ ? ' ring-scale-400 border-scale-800 !bg-indigo-900 ring-2 drop-shadow-lg dark:ring-white'
+ : '',
+ ].join(' ')}
+ ></button>
+ </div>
+ </div>
+
+ <div className="flex flex-col gap-2">
+ <label className="text-scale-1200 text-base">Rounded corners</label>
+ <div className="flex items-center gap-3">
+ <button
+ onClick={() => setRadius('4px')}
+ className={[
+ 'bg-scale-100 dark:bg-scale-400 border-scale-500 ring-scale-400 border-scale-800 h-10 w-10 rounded-full border hover:scale-105',
+ radius === '4px'
+ ? 'ring-scale-400 border-scale-800 border-2 ring-2 dark:ring-white'
+ : '',
+ ].join(' ')}
+ ></button>
+ <button
+ onClick={() => setRadius('10px')}
+ className={[
+ 'bg-scale-100 dark:bg-scale-400 border-scale-500 h-10 w-10 rounded-full border transition hover:scale-105 ',
+ radius === '10px'
+ ? 'ring-scale-400 border-scale-800 border-2 ring-2 dark:ring-white'
+ : '',
+ ].join(' ')}
+ ></button>
+ <button
+ onClick={() => setRadius('32px')}
+ className={[
+ 'bg-scale-100 dark:bg-scale-400 border-scale-500 h-10 w-10 rounded-full border transition hover:scale-105 ',
+ radius === '32px'
+ ? 'ring-scale-400 border-scale-800 border-2 ring-2 dark:ring-white'
+ : '',
+ ].join(' ')}
+ ></button>
+ </div>
+ </div>
+
+ <div className="flex flex-col gap-2">
+ <label className="text-scale-1200 text-base">Language</label>
+ <div className="flex items-center gap-3">
+ <Button type="default">English</Button>
+ <Button type="default">Japanese</Button>
+ </div>
+ </div>
+
+ <div className="flex flex-col gap-2">
+ <label className="text-scale-1200 text-base">Social Auth Layout</label>
+ <div className="flex items-center gap-3">
+ <button
+ onClick={() => setLayout('horizontal')}
+ className={[
+ 'dark:bg-scale-400 bg-scale-100 dark:border-scale-500 border-scale-500 flex h-10 w-10 items-center justify-center rounded-full border transition hover:scale-105 ',
+ layout === 'horizontal'
+ ? 'ring-scale-400 border-scale-800 border-2 ring-2 dark:ring-white'
+ : '',
+ ].join(' ')}
+ >
+ <MenuIcon className="text-scale-900 dark:text-scale-1100 w-6 rotate-90" />
+ </button>{' '}
+ <button
+ onClick={() => setLayout('vertical')}
+ className={[
+ 'dark:bg-scale-400 bg-scale-100 dark:border-scale-500 border-scale-500 flex h-10 w-10 items-center justify-center rounded-full border transition hover:scale-105 ',
+ layout === 'vertical'
+ ? 'ring-scale-400 border-scale-800 border-2 ring-2 dark:ring-white'
+ : '',
+ ].join(' ')}
+ >
+ <MenuIcon className="text-scale-900 dark:text-scale-1100 w-6" />
+ </button>
+ </div>
+ </div>
+ </div>
+
+ <Link
+ href="https://github.com/supabase/ui#using-supabase-ui-auth"
+ as="https://github.com/supabase/ui#using-supabase-ui-auth"
+ >
+ <a>
+ <Button size="small" type="default" className="mt-4" icon={<IconArrowUpRight />}>
+ Explore documentation
+ </Button>
+ </a>
+ </Link>
+ </div>
+ </div>
+ </div>
+ </div>
+ )
+}
+
+export default AuthWidgetSection
diff --git a/apps/www/package.json b/apps/www/package.json
index b2b357c278c..f1ab6d7b664 100644
--- a/apps/www/package.json
+++ b/apps/www/package.json
@@ -17,6 +17,7 @@
"@mdx-js/loader": "^1.6.22",
"@mdx-js/react": "^1.6.22",
"@next/mdx": "^10.0.7",
+ "@supabase/auth-ui-react": "^0.1.4",
"@supabase/supabase-js": "^1.6.0",
"@supabase/ui": "v0.37.0-alpha.80",
"classnames": "^2.3.1",
@@ -66,7 +67,7 @@
"postcss": "^8.4.7",
"postcss-preset-env": "^6.7.0",
"prettier": "^2.2.1",
- "tailwindcss": "^3.0.23"
+ "tailwindcss": "^3.1.0"
},
"license": "MIT"
}
diff --git a/apps/www/pages/auth/Auth.tsx b/apps/www/pages/auth/Auth.tsx
index 1a1e2233547..654866101da 100644
--- a/apps/www/pages/auth/Auth.tsx
+++ b/apps/www/pages/auth/Auth.tsx
@@ -18,6 +18,7 @@ import Image from 'next/image'
import Link from 'next/link'
import { useRouter } from 'next/router'
import AuthComponentExample from '~/components/AuthWidget/AuthComponentExample'
+import AuthWidgetSection from '~/components/AuthWidget/AuthWidgetSection'
import SplitCodeBlockCarousel from '~/components/Carousels/SplitCodeBlockCarousel'
import CTABanner from '~/components/CTABanner'
import FeatureColumn from '~/components/FeatureColumn'
@@ -246,14 +247,16 @@ function AuthPage() {
</div>
</SectionContainer>
+ <AuthWidgetSection />
+
{/* <SectionContainer>
<div className="grid grid-cols-12 lg:gap-16">
- <div className="order-last col-span-12 lg:order-first lg:col-span-6 mt-8 lg:mt-0">
+ <div className="order-last col-span-12 mt-8 lg:order-first lg:col-span-6 lg:mt-0">
<AuthComponentExample />
</div>
<div className="col-span-12 lg:col-span-6 lg:col-start-7 xl:col-span-4 xl:col-start-8">
<div className="mb-4 flex items-center space-x-2">
- <div className="w-8 h-8 rounded-md bg-gray-900 dark:bg-white text-white dark:text-gray-900 flex justify-center items-center">
+ <div className="flex h-8 w-8 items-center justify-center rounded-md bg-gray-900 text-white dark:bg-white dark:text-gray-900">
<ProductIcon icon={Solutions['authentication'].icon} />
</div>
<p className="m-0">
@@ -283,7 +286,7 @@ function AuthPage() {
</a>
</Link>
- <div className="grid grid-cols-12 md:gap-8 lg:gap-0 xl:gap-16 mt-8">
+ <div className="mt-8 grid grid-cols-12 md:gap-8 lg:gap-0 xl:gap-16">
<div className="col-span-12 lg:col-span-12 xl:col-span-4">
<FeatureColumn
icon={<IconBriefcase />}
diff --git a/apps/www/styles/index.css b/apps/www/styles/index.css
index e24be00f755..2786744dec3 100644
--- a/apps/www/styles/index.css
+++ b/apps/www/styles/index.css
@@ -189,7 +189,7 @@ h6 { */
width: 420px;
} */
-.auth-container {
+/* .auth-container {
@apply rounded;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23edebf0' fill-opacity='0.4'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
@@ -197,7 +197,7 @@ h6 { */
.dark .auth-container {
background-color: #181818;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23313131' fill-opacity='0.4'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9z'/%3E%3Cpath d='M6 5V0H5v5H0v1h5v94h1V6h94V5H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
-}
+} */
.dark .header--light {
display: none;
@@ -308,7 +308,7 @@ launch week
}
.video-container {
- @apply border rounded-xl overflow-hidden;
+ @apply overflow-hidden rounded-xl border;
position: relative;
width: 100%;
padding-bottom: 56.25%;
@@ -322,3 +322,148 @@ launch week
height: 100%;
border: 0;
}
+
+.all-unset {
+ all: unset;
+}
+
+.auth-container {
+ background: linear-gradient(270deg, #71fb8e, #acecbc);
+ background-size: 400% 400%;
+
+ -webkit-animation: AnimationName 14s ease infinite;
+ -moz-animation: AnimationName 14s ease infinite;
+ animation: AnimationName 14s ease infinite;
+}
+
+@-webkit-keyframes AnimationName {
+ 0% {
+ background-position: 0% 50%;
+ }
+ 50% {
+ background-position: 100% 50%;
+ }
+ 100% {
+ background-position: 0% 50%;
+ }
+}
+@-moz-keyframes AnimationName {
+ 0% {
+ background-position: 0% 50%;
+ }
+ 50% {
+ background-position: 100% 50%;
+ }
+ 100% {
+ background-position: 0% 50%;
+ }
+}
+@keyframes AnimationName {
+ 0% {
+ background-position: 0% 50%;
+ }
+ 50% {
+ background-position: 100% 50%;
+ }
+ 100% {
+ background-position: 0% 50%;
+ }
+}
+
+@property --rotate {
+ syntax: '<angle>';
+ initial-value: 132deg;
+ inherits: false;
+}
+
+:root {
+ --card-height: 50vh;
+ /* --card-width: calc(var(--card-height) / 2); */
+}
+
+/* body {
+ min-height: 100vh;
+ background: #212534;
+ display: flex;
+ align-items: center;
+ flex-direction: column;
+ padding-top: 2rem;
+ padding-bottom: 2rem;
+ box-sizing: border-box;
+} */
+.glow-area {
+ /* background: #191c29; */
+ width: 100%;
+ /* //var(--card-width); */
+ height: 100%;
+ /* var(--card-height); */
+ /* padding: 3px; */
+ position: absolute;
+ background-color: transparent;
+ z-index: -1;
+ /* position: relative; */
+ /* border-radius: 6px; */
+ /* justify-content: center;
+ align-items: center;
+ text-align: center;
+ display: flex; */
+ /* color: rgb(88 199 250 / 0%); */
+ cursor: pointer;
+}
+
+/* .glow-area:hover {
+ color: rgb(88 199 250 / 100%);
+ transition: color 1s;
+} */
+/* .glow-area:hover:before,
+.glow-area:hover:after {
+ animation: none;
+ opacity: 0;
+} */
+
+.glow-area::before {
+ /* content: '';
+ width: 104%;
+ height: 102%; */
+ /* border-radius: 8px; */
+ /* background-image: linear-gradient(var(--rotate), #5ddcff, #3c67e3 43%, #4e00c2); */
+ /* position: absolute; */
+ /* z-index: -1; */
+ /* top: -1%;
+ left: -2%; */
+ /* animation: spin 10s linear infinite; */
+}
+
+.glow-area::after {
+ position: absolute;
+ /* background: pink; */
+ content: '';
+ top: calc(var(--card-height) / 8);
+ /* calc(var(--card-height) / 6); */
+ left: 0;
+ right: 0;
+ z-index: -1;
+ height: 100%;
+ width: 100%;
+ margin: 0 auto;
+ transform: scale(0.75);
+ filter: blur(calc(var(--card-height) / 6));
+ background-image: linear-gradient(
+ var(--rotate),
+ var(--colors-brand),
+ #3c67e3 43%,
+ var(--colors-brand)
+ );
+ opacity: 1;
+ transition: opacity 0.5s;
+ animation: spin 8s linear infinite;
+}
+
+@keyframes spin {
+ 0% {
+ --rotate: 0deg;
+ }
+ 100% {
+ --rotate: 360deg;
+ }
+}
diff --git a/apps/www/tailwind.config.js b/apps/www/tailwind.config.js
index 9c2af498997..ac202baf885 100644
--- a/apps/www/tailwind.config.js
+++ b/apps/www/tailwind.config.js
@@ -1 +1,13 @@
-module.exports = require('config/tailwind.config')
+const config = require('config/tailwind.config')
+
+const extend = {
+ colors: {
+ 'auth-widget': {
+ brand: 'var(--colors-brand)',
+ label: 'var(--colors-brand)',
+ input: 'var(--colors-inputText)',
+ },
+ },
+}
+
+module.exports = config(extend)
diff --git a/package-lock.json b/package-lock.json
index 717d64d8220..c1a404ded0c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1306,6 +1306,7 @@
"@mdx-js/loader": "^1.6.22",
"@mdx-js/react": "^1.6.22",
"@next/mdx": "^10.0.7",
+ "@supabase/auth-ui-react": "^0.1.4",
"@supabase/supabase-js": "^1.6.0",
"@supabase/ui": "v0.37.0-alpha.80",
"classnames": "^2.3.1",
@@ -1355,7 +1356,7 @@
"postcss": "^8.4.7",
"postcss-preset-env": "^6.7.0",
"prettier": "^2.2.1",
- "tailwindcss": "^3.0.23"
+ "tailwindcss": "^3.1.0"
}
},
"apps/www/node_modules/@jest/types": {
@@ -5020,6 +5021,37 @@
"@sinonjs/commons": "^1.7.0"
}
},
+ "node_modules/@stitches/core": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/@stitches/core/-/core-1.2.8.tgz",
+ "integrity": "sha512-Gfkvwk9o9kE9r9XNBmJRfV8zONvXThnm1tcuojL04Uy5uRyqg93DC83lDebl0rocZCfKSjUv+fWYtMQmEDJldg=="
+ },
+ "node_modules/@stitches/react": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/@stitches/react/-/react-1.2.8.tgz",
+ "integrity": "sha512-9g9dWI4gsSVe8bNLlb+lMkBYsnIKCZTmvqvDG+Avnn69XfmHZKiaMrx7cgTaddq7aTPPmXiTsbFcUy0xgI4+wA==",
+ "peerDependencies": {
+ "react": ">= 16.3.0"
+ }
+ },
+ "node_modules/@supabase/auth-ui-react": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/@supabase/auth-ui-react/-/auth-ui-react-0.1.4.tgz",
+ "integrity": "sha512-sE0e8D/EsuvRQST8TresY6RlVK3S6cjRHa9SXJA8EZ/BNVCCQZNegHeRlKtGHL7mxIS9Fl7Vl4KFMWYmdbyrvw==",
+ "dependencies": {
+ "@stitches/core": "^1.2.8",
+ "@stitches/react": "^1.2.8",
+ "lodash": "^4.17.20",
+ "prop-types": "^15.7.2"
+ },
+ "optionalDependencies": {
+ "fsevents": "^2.3.2"
+ },
+ "peerDependencies": {
+ "react": "^16.13.1 || ^17.0.1",
+ "react-dom": "^16.13.1 || ^17.0.1"
+ }
+ },
"node_modules/@supabase/functions-js": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-1.3.4.tgz",
@@ -20986,6 +21018,29 @@
"@sinonjs/commons": "^1.7.0"
}
},
+ "@stitches/core": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/@stitches/core/-/core-1.2.8.tgz",
+ "integrity": "sha512-Gfkvwk9o9kE9r9XNBmJRfV8zONvXThnm1tcuojL04Uy5uRyqg93DC83lDebl0rocZCfKSjUv+fWYtMQmEDJldg=="
+ },
+ "@stitches/react": {
+ "version": "1.2.8",
+ "resolved": "https://registry.npmjs.org/@stitches/react/-/react-1.2.8.tgz",
+ "integrity": "sha512-9g9dWI4gsSVe8bNLlb+lMkBYsnIKCZTmvqvDG+Avnn69XfmHZKiaMrx7cgTaddq7aTPPmXiTsbFcUy0xgI4+wA==",
+ "requires": {}
+ },
+ "@supabase/auth-ui-react": {
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/@supabase/auth-ui-react/-/auth-ui-react-0.1.4.tgz",
+ "integrity": "sha512-sE0e8D/EsuvRQST8TresY6RlVK3S6cjRHa9SXJA8EZ/BNVCCQZNegHeRlKtGHL7mxIS9Fl7Vl4KFMWYmdbyrvw==",
+ "requires": {
+ "@stitches/core": "^1.2.8",
+ "@stitches/react": "^1.2.8",
+ "fsevents": "^2.3.2",
+ "lodash": "^4.17.20",
+ "prop-types": "^15.7.2"
+ }
+ },
"@supabase/functions-js": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-1.3.4.tgz",
@@ -31481,6 +31536,7 @@
"@mdx-js/loader": "^1.6.22",
"@mdx-js/react": "^1.6.22",
"@next/mdx": "^10.0.7",
+ "@supabase/auth-ui-react": "^0.1.4",
"@supabase/supabase-js": "^1.6.0",
"@supabase/ui": "v0.37.0-alpha.80",
"@tailwindcss/typography": "^0.5.2",
@@ -31525,7 +31581,7 @@
"remark-html": "10.0.0",
"swiper": "^6.5.0",
"swr": "^0.5.4",
- "tailwindcss": "^3.0.23",
+ "tailwindcss": "^3.1.0",
"typescript": "^4.0.3",
"use-debounce": "^7.0.1",
"uuid": "^8.3.2"
diff --git a/packages/config/tailwind.config.js b/packages/config/tailwind.config.js
index d977515425d..352dbca42db 100644
--- a/packages/config/tailwind.config.js
+++ b/packages/config/tailwind.config.js
@@ -12,253 +12,258 @@
const ui = require('./ui.config.js')
const svgToDataUri = require('mini-svg-data-uri')
-module.exports = ui({
- mode: 'JIT',
- content: [
- '../../packages/common/**/*.{ts,tsx}',
- './src/**/*.{ts,tsx,mdx}',
- './components/**/*.tsx',
- './layouts/**/*.tsx',
- './pages/**/*.{tsx,mdx}',
- './_blog/*.mdx',
- // purge styles from supabase ui theme
- '../../node_modules/@supabase/ui/dist/config/default-theme.js',
- ],
- darkMode: 'class', // 'media' or 'class'
- // mode: 'jit',
- theme: {
- borderColor: (theme) => ({
- ...theme('colors'),
- DEFAULT: theme('colors.scale.300', 'currentColor'),
- dark: theme('colors.scale.1200', 'currentColor'),
- }),
- divideColor: (theme) => ({
- ...theme('colors'),
- DEFAULT: theme('colors.scale.300', 'currentColor'),
- dark: theme('colors.scale.600', 'currentColor'),
- }),
- extend: {
- typography: ({ theme }) => ({
- // Removal of backticks in code blocks for tailwind v3.0
- // https://github.com/tailwindlabs/tailwindcss-typography/issues/135
- DEFAULT: {
- css: {
- 'code::before': {
- content: '""',
- },
- 'code::after': {
- content: '""',
- },
- '--tw-prose-body': theme('colors.scale[1100]'),
- '--tw-prose-headings': theme('colors.scale[1200]'),
- '--tw-prose-lead': theme('colors.scale[1100]'),
- '--tw-prose-links': theme('colors.brand[900]'),
- '--tw-prose-bold': theme('colors.scale[1100]'),
- '--tw-prose-counters': theme('colors.scale[1100]'),
- '--tw-prose-bullets': theme('colors.scale[900]'),
- '--tw-prose-hr': theme('colors.scale[500]'),
- '--tw-prose-quotes': theme('colors.scale[1100]'),
- '--tw-prose-quote-borders': theme('colors.scale[500]'),
- '--tw-prose-captions': theme('colors.scale[700]'),
- '--tw-prose-code': theme('colors.scale[1200]'),
- '--tw-prose-pre-code': theme('colors.scale[900]'),
- '--tw-prose-pre-bg': theme('colors.scale[400]'),
- '--tw-prose-th-borders': theme('colors.scale[500]'),
- '--tw-prose-td-borders': theme('colors.scale[200]'),
- '--tw-prose-invert-body': theme('colors.scale[200]'),
- '--tw-prose-invert-headings': theme('colors.white'),
- '--tw-prose-invert-lead': theme('colors.scale[500]'),
- '--tw-prose-invert-links': theme('colors.white'),
- '--tw-prose-invert-bold': theme('colors.white'),
- '--tw-prose-invert-counters': theme('colors.scale[400]'),
- '--tw-prose-invert-bullets': theme('colors.scale[600]'),
- '--tw-prose-invert-hr': theme('colors.scale[700]'),
- '--tw-prose-invert-quotes': theme('colors.scale[100]'),
- '--tw-prose-invert-quote-borders': theme('colors.scale[700]'),
- '--tw-prose-invert-captions': theme('colors.scale[400]'),
- // the following are typography overrides
- // examples can be seen here —> https://github.com/tailwindlabs/tailwindcss-typography/blob/master/src/styles.js
- // reset all header font weights
- 'h1, h2, h3, h4, h5': {
- fontWeight: '400',
- },
- h2: {
- fontWeight: '400',
- },
- p: {
- fontWeight: '400',
- },
- a: {
- fontWeight: '400',
- },
- pre: {
- background: 'none',
- padding: 0,
- marginBottom: '32px',
- },
- 'p img': {
- border: '1px solid var(--colors-scale4)',
- borderRadius: '4px',
- overflow: 'hidden',
- },
- iframe: {
- border: '1px solid ' + theme('borderColor.DEFAULT'),
- borderRadius: theme('borderRadius.lg'),
- },
- },
+module.exports = function (extend) {
+ return ui({
+ mode: 'JIT',
+ content: [
+ '../../packages/common/**/*.{ts,tsx}',
+ './src/**/*.{ts,tsx,mdx}',
+ './components/**/*.tsx',
+ './layouts/**/*.tsx',
+ './pages/**/*.{tsx,mdx}',
+ './_blog/*.mdx',
+ // purge styles from supabase ui theme
+ '../../node_modules/@supabase/ui/dist/config/default-theme.js',
+ ],
+ darkMode: 'class', // 'media' or 'class'
+ // mode: 'jit',
+ theme: {
+ borderColor: (theme) => ({
+ ...theme('colors'),
+ DEFAULT: theme('colors.scale.300', 'currentColor'),
+ dark: theme('colors.scale.1200', 'currentColor'),
+ }),
+ divideColor: (theme) => ({
+ ...theme('colors'),
+ DEFAULT: theme('colors.scale.300', 'currentColor'),
+ dark: theme('colors.scale.600', 'currentColor'),
+ }),
+ extend: {
+ colors: {
+ ...extend.colors,
},
-
- toc: {
- css: {
- ul: {
- 'list-style-type': 'none',
- 'padding-left': 0,
- margin: 0,
- li: {
- 'padding-left': 0,
+ typography: ({ theme }) => ({
+ // Removal of backticks in code blocks for tailwind v3.0
+ // https://github.com/tailwindlabs/tailwindcss-typography/issues/135
+ DEFAULT: {
+ css: {
+ 'code::before': {
+ content: '""',
+ },
+ 'code::after': {
+ content: '""',
+ },
+ '--tw-prose-body': theme('colors.scale[1100]'),
+ '--tw-prose-headings': theme('colors.scale[1200]'),
+ '--tw-prose-lead': theme('colors.scale[1100]'),
+ '--tw-prose-links': theme('colors.brand[900]'),
+ '--tw-prose-bold': theme('colors.scale[1100]'),
+ '--tw-prose-counters': theme('colors.scale[1100]'),
+ '--tw-prose-bullets': theme('colors.scale[900]'),
+ '--tw-prose-hr': theme('colors.scale[500]'),
+ '--tw-prose-quotes': theme('colors.scale[1100]'),
+ '--tw-prose-quote-borders': theme('colors.scale[500]'),
+ '--tw-prose-captions': theme('colors.scale[700]'),
+ '--tw-prose-code': theme('colors.scale[1200]'),
+ '--tw-prose-pre-code': theme('colors.scale[900]'),
+ '--tw-prose-pre-bg': theme('colors.scale[400]'),
+ '--tw-prose-th-borders': theme('colors.scale[500]'),
+ '--tw-prose-td-borders': theme('colors.scale[200]'),
+ '--tw-prose-invert-body': theme('colors.scale[200]'),
+ '--tw-prose-invert-headings': theme('colors.white'),
+ '--tw-prose-invert-lead': theme('colors.scale[500]'),
+ '--tw-prose-invert-links': theme('colors.white'),
+ '--tw-prose-invert-bold': theme('colors.white'),
+ '--tw-prose-invert-counters': theme('colors.scale[400]'),
+ '--tw-prose-invert-bullets': theme('colors.scale[600]'),
+ '--tw-prose-invert-hr': theme('colors.scale[700]'),
+ '--tw-prose-invert-quotes': theme('colors.scale[100]'),
+ '--tw-prose-invert-quote-borders': theme('colors.scale[700]'),
+ '--tw-prose-invert-captions': theme('colors.scale[400]'),
+ // the following are typography overrides
+ // examples can be seen here —> https://github.com/tailwindlabs/tailwindcss-typography/blob/master/src/styles.js
+ // reset all header font weights
+ 'h1, h2, h3, h4, h5': {
+ fontWeight: '400',
+ },
+ h2: {
+ fontWeight: '400',
+ },
+ p: {
+ fontWeight: '400',
},
a: {
- display: 'block',
- marginBottom: '0.4rem',
- 'text-decoration': 'none',
- fontSize: '0.8rem',
- fontWeight: '200',
- color: theme('colors.scale[1100]'),
- '&:hover': {
- color: theme('colors.scale[1200]'),
- },
- 'font-weight': '400',
+ fontWeight: '400',
+ },
+ pre: {
+ background: 'none',
+ padding: 0,
+ marginBottom: '32px',
+ },
+ 'p img': {
+ border: '1px solid var(--colors-scale4)',
+ borderRadius: '4px',
+ overflow: 'hidden',
},
- // margin: 0,
+ iframe: {
+ border: '1px solid ' + theme('borderColor.DEFAULT'),
+ borderRadius: theme('borderRadius.lg'),
+ },
+ },
+ },
+
+ toc: {
+ css: {
ul: {
'list-style-type': 'none',
+ 'padding-left': 0,
+ margin: 0,
li: {
- marginTop: '0.2rem',
- marginBottom: '0.2rem',
- 'padding-left': '0 !important',
- 'margin-left': '0.5rem',
+ 'padding-left': 0,
},
a: {
+ display: 'block',
+ marginBottom: '0.4rem',
+ 'text-decoration': 'none',
+ fontSize: '0.8rem',
fontWeight: '200',
- color: theme('colors.scale[1000]'),
+ color: theme('colors.scale[1100]'),
'&:hover': {
color: theme('colors.scale[1200]'),
},
+ 'font-weight': '400',
+ },
+ // margin: 0,
+ ul: {
+ 'list-style-type': 'none',
+ li: {
+ marginTop: '0.2rem',
+ marginBottom: '0.2rem',
+ 'padding-left': '0 !important',
+ 'margin-left': '0.5rem',
+ },
+ a: {
+ fontWeight: '200',
+ color: theme('colors.scale[1000]'),
+ '&:hover': {
+ color: theme('colors.scale[1200]'),
+ },
+ },
},
},
},
},
+ }),
+ // screens: {
+ // sm: '640px',
+ // // => @media (min-width: 640px) { ... }
+ // md: '768px',
+ // // => @media (min-width: 768px) { ... }
+ // lg: '1024px',
+ // // => @media (min-width: 1024px) { ... }
+ // xl: '1280px',
+ // // => @media (min-width: 1280px) { ... }
+ // '2xl': '1536px',
+ // // => @media (min-width: 1536px) { ... }
+ // },
+ // colors: {
+ // 'gray-light': '#7B7F86',
+ // 'gray-dark': '#7B7F86',
+ // 'accent-1': '#FAFAFA',
+ // 'accent-2': '#EAEAEA',
+ // 'accent-7': '#333',
+ // success: '#0070f3',
+ // cyan: '#79FFE1',
+ // // brand: {
+ // // 100: '#82dab0',
+ // // 200: '#69d3a0',
+ // // 300: '#50cb90',
+ // // 400: '#C5F1DD',
+ // // 500: '#9FE7C7',
+ // // 600: '#65D9A5',
+ // // 700: '#3ECF8E',
+ // // 800: '#38BC81',
+ // // 900: '#10633E',
+ // // },
+ // // Joshen TODO: At the end just rearrange the values
+ // dark: {
+ // 100: '#eeeeee',
+ // 200: '#e0e0e0',
+ // 300: '#bbbbbb',
+ // 400: '#666666',
+ // 500: '#444444',
+ // 600: '#2a2a2a',
+ // 700: '#1f1f1f',
+ // 800: '#181818',
+ // 900: '#0f0f0f',
+ // },
+ // // gray: {
+ // // 100: '#eeeeee',
+ // // 200: '#e0e0e0',
+ // // 300: '#bbbbbb',
+ // // 400: '#666666',
+ // // 500: '#444444',
+ // // 600: '#2a2a2a',
+ // // 700: '#1f1f1f',
+ // // 800: '#181818',
+ // // 900: '#0f0f0f',
+ // // },
+ // },
+ // spacing: {
+ // 28: '7rem',
+ // },
+ // letterSpacing: {
+ // tighter: '-.04em',
+ // },
+ // lineHeight: {
+ // tight: 1.2,
+ // },
+ // fontSize: {
+ // '5xl': '2.5rem',
+ // '6xl': '2.75rem',
+ // '7xl': '4.5rem',
+ // '8xl': '6.25rem',
+ // },
+ // boxShadow: {
+ // 'light-small': '0px 4px 8px 2px rgba(107, 114, 128, 0.08)',
+ // small: '0 5px 10px rgba(0, 0, 0, 0.12)',
+ // medium: '0 8px 30px rgba(0, 0, 0, 0.12)',
+ // override: '0px 0px 0px rgba(0, 0, 0, 0)',
+ // },
+ fontFamily: {
+ sans: ['custom-font', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif'],
+ mono: ['Source Code Pro', 'Menlo', 'monospace'],
},
- }),
- // screens: {
- // sm: '640px',
- // // => @media (min-width: 640px) { ... }
- // md: '768px',
- // // => @media (min-width: 768px) { ... }
- // lg: '1024px',
- // // => @media (min-width: 1024px) { ... }
- // xl: '1280px',
- // // => @media (min-width: 1280px) { ... }
- // '2xl': '1536px',
- // // => @media (min-width: 1536px) { ... }
- // },
- // colors: {
- // 'gray-light': '#7B7F86',
- // 'gray-dark': '#7B7F86',
- // 'accent-1': '#FAFAFA',
- // 'accent-2': '#EAEAEA',
- // 'accent-7': '#333',
- // success: '#0070f3',
- // cyan: '#79FFE1',
- // // brand: {
- // // 100: '#82dab0',
- // // 200: '#69d3a0',
- // // 300: '#50cb90',
- // // 400: '#C5F1DD',
- // // 500: '#9FE7C7',
- // // 600: '#65D9A5',
- // // 700: '#3ECF8E',
- // // 800: '#38BC81',
- // // 900: '#10633E',
- // // },
- // // Joshen TODO: At the end just rearrange the values
- // dark: {
- // 100: '#eeeeee',
- // 200: '#e0e0e0',
- // 300: '#bbbbbb',
- // 400: '#666666',
- // 500: '#444444',
- // 600: '#2a2a2a',
- // 700: '#1f1f1f',
- // 800: '#181818',
- // 900: '#0f0f0f',
- // },
- // // gray: {
- // // 100: '#eeeeee',
- // // 200: '#e0e0e0',
- // // 300: '#bbbbbb',
- // // 400: '#666666',
- // // 500: '#444444',
- // // 600: '#2a2a2a',
- // // 700: '#1f1f1f',
- // // 800: '#181818',
- // // 900: '#0f0f0f',
- // // },
- // },
- // spacing: {
- // 28: '7rem',
- // },
- // letterSpacing: {
- // tighter: '-.04em',
- // },
- // lineHeight: {
- // tight: 1.2,
- // },
- // fontSize: {
- // '5xl': '2.5rem',
- // '6xl': '2.75rem',
- // '7xl': '4.5rem',
- // '8xl': '6.25rem',
- // },
- // boxShadow: {
- // 'light-small': '0px 4px 8px 2px rgba(107, 114, 128, 0.08)',
- // small: '0 5px 10px rgba(0, 0, 0, 0.12)',
- // medium: '0 8px 30px rgba(0, 0, 0, 0.12)',
- // override: '0px 0px 0px rgba(0, 0, 0, 0)',
- // },
- fontFamily: {
- sans: ['custom-font', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif'],
- mono: ['Source Code Pro', 'Menlo', 'monospace'],
- },
- // stroke: (theme) => ({
- // white: theme('colors.white'),
- // black: theme('colors.black'),
- // }),
- backgroundImage: (theme) => ({
- squiggle: `url("${svgToDataUri(
- `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 3" enable-background="new 0 0 6 3" width="6" height="3" fill="${theme(
- 'colors.yellow.400'
- )}"><polygon points="5.5,0 2.5,3 1.1,3 4.1,0"/><polygon points="4,0 6,2 6,0.6 5.4,0"/><polygon points="0,2 1,3 2.4,3 0,0.6"/></svg>`
- )}")`,
- }),
- keyframes: {
- 'flash-code': {
- '0%': { backgroundColor: 'rgba(63, 207, 142, 0.1)' },
- '100%': { backgroundColor: 'transparent' },
+ // stroke: (theme) => ({
+ // white: theme('colors.white'),
+ // black: theme('colors.black'),
+ // }),
+ backgroundImage: (theme) => ({
+ squiggle: `url("${svgToDataUri(
+ `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 3" enable-background="new 0 0 6 3" width="6" height="3" fill="${theme(
+ 'colors.yellow.400'
+ )}"><polygon points="5.5,0 2.5,3 1.1,3 4.1,0"/><polygon points="4,0 6,2 6,0.6 5.4,0"/><polygon points="0,2 1,3 2.4,3 0,0.6"/></svg>`
+ )}")`,
+ }),
+ keyframes: {
+ 'flash-code': {
+ '0%': { backgroundColor: 'rgba(63, 207, 142, 0.1)' },
+ '100%': { backgroundColor: 'transparent' },
+ },
+ },
+ animation: {
+ 'flash-code': 'flash-code 1s forwards',
+ 'flash-code-slow': 'flash-code 2s forwards',
},
- },
- animation: {
- 'flash-code': 'flash-code 1s forwards',
- 'flash-code-slow': 'flash-code 2s forwards',
},
},
- },
- // variants: {
- // extend: {
- // inset: ['group-hover'],
- // stroke: ['dark'],
- // height: ['hover'],
- // },
- // },
- plugins: [require('@tailwindcss/typography')],
-})
+ // variants: {
+ // extend: {
+ // inset: ['group-hover'],
+ // stroke: ['dark'],
+ // height: ['hover'],
+ // },
+ // },
+ plugins: [require('@tailwindcss/typography')],
+ })
+}