Skip to content

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

Merge branch 'master' into jsm/design-tokens-poc-2

Jonathan Summers-Muir066e00af29b9
diff --cc apps/www/pages/_app.tsx
index 3111f3c3efa,9698060202f..86387075e61
--- a/apps/www/pages/_app.tsx
+++ b/apps/www/pages/_app.tsx
@@@ -5,11 -5,8 +5,11 @@@ import { useRouter } from 'next/router
import { useEffect } from 'react'
import Meta from '~/components/Favicons'
import '../styles/index.css'
+import '../../../packages/ui/styles/base/global.css'
+import '../../../packages/ui/styles/themes/light.css'
+import '../../../packages/ui/styles/themes/dark.css'
import { post } from './../lib/fetchWrapper'
- import { ThemeProvider } from '~/components/Providers'
+ import { ThemeProvider } from 'common/Providers'
import Head from 'next/head'
export default function MyApp({ Component, pageProps }: AppProps) {
diff --cc packages/config/tailwind.config.js
index 88a974d5243,ea65cdfe23f..f5b73b9fb55
--- a/packages/config/tailwind.config.js
+++ b/packages/config/tailwind.config.js
@@@ -31,28 -14,12 +31,27 @@@ const uiConfig = ui(
'./_blog/*.mdx',
// purge styles from supabase ui theme
],
- darkMode: 'class', // 'media' or 'class'
- // mode: 'jit',
+ darkMode: 'class',
theme: {
+ accentColor: (theme) => ({
+ ...theme('colors'),
+ ...generateTwColorClasses('accentColor', color),
+ }),
+ backgroundColor: (theme) => ({
+ ...theme('colors'),
+ ...generateTwColorClasses('backgroundColor', color),
+ }),
borderColor: (theme) => ({
...theme('colors'),
- DEFAULT: theme('colors.scale.300', 'currentColor'),
- dark: theme('colors.scale.1200', 'currentColor'),
+ ...generateTwColorClasses('borderColor', color),
+ }),
+ boxShadowColor: (theme) => ({
+ ...theme('colors'),
+ ...generateTwColorClasses('boxShadowColor', color),
+ }),
+ caretColor: (theme) => ({
+ ...theme('colors'),
+ ...generateTwColorClasses('caretColor', color),
}),
divideColor: (theme) => ({
...theme('colors'),
@@@ -279,26 -228,16 +279,37 @@@
},
},
},
- plugins: [require('@tailwindcss/typography')],
+ plugins: [
+ require('@tailwindcss/typography'),
+ function ({ addUtilities, addVariant }) {
+ addUtilities({
+ // prose (tailwind typography) helpers
+ // useful for removing margins in prose styled sections
+ '.prose--remove-p-margin p': {
+ margin: '0',
+ },
+ })
+ },
+ ],
})
+
+/**
+ * Merge Supabase UI and Tailwind CSS configurations
+ * @param {object} tailwindConfig - Tailwind config object
+ * @return {object} new config object
+ */
+function wrapper(tailwindConfig) {
+ let purge
+ if (Array.isArray(tailwindConfig.purge)) {
+ purge = {
+ content: tailwindConfig.purge,
+ }
+ } else {
+ purge = tailwindConfig.purge
+ }
+ return deepMerge({ ...tailwindConfig, purge }, uiConfig, {
+ arrayMerge: arrayMergeFn,
+ })
+}
+
+module.exports = wrapper