Skip to content

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

remove old tailwind config

Jonathan Summers-Muirac6388ae411a
diff --git a/apps/docs/pages/_app.tsx b/apps/docs/pages/_app.tsx
index f3f6b65f63a..ac699008ad6 100644
--- a/apps/docs/pages/_app.tsx
+++ b/apps/docs/pages/_app.tsx
@@ -11,6 +11,9 @@ import SearchProvider from '~/components/Search/SearchProvider'
import SiteLayout from '~/layouts/SiteLayout'
import { IS_PLATFORM, LOCAL_SUPABASE } from '~/lib/constants'
import { post } from '~/lib/fetchWrappers'
+import '../../../packages/ui/styles/base/global.css'
+import '../../../packages/ui/styles/themes/light.css'
+import '../../../packages/ui/styles/themes/dark.css'
import '../styles/algolia-search.scss'
import '../styles/ch.scss'
import '../styles/docsearch.scss'
diff --git a/apps/docs/styles/main.scss b/apps/docs/styles/main.scss
index a2d3f90d7b4..1e90600edc0 100644
--- a/apps/docs/styles/main.scss
+++ b/apps/docs/styles/main.scss
@@ -23,7 +23,7 @@
}
body {
- @apply bg #{!important};
+ @apply bg-body #{!important};
scroll-behavior: smooth;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
diff --git a/apps/docs/tailwind.config.js b/apps/docs/tailwind.config.js
index 9c2af498997..ea5f1b6a07d 100644
--- a/apps/docs/tailwind.config.js
+++ b/apps/docs/tailwind.config.js
@@ -1 +1,25 @@
-module.exports = require('config/tailwind.config')
+const config = require('config/tailwind.config')
+
+module.exports = config({
+ content: [
+ './../../packages/common/**/*.{ts,tsx}',
+ './../../packages/ui/**/*.{tsx,ts,js}',
+ './pages/**/*.{tsx,mdx}',
+ './components/**/*.tsx',
+ './layouts/**/*.tsx',
+ './src/**/*.{ts,tsx,mdx}',
+ './docs/**/*.{tsx,mdx}',
+ ],
+ 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',
+ },
+ })
+ },
+ ],
+})
diff --git a/apps/temp-community-forum/package.json b/apps/temp-community-forum/package.json
index c5984bf7e45..6a63ff17f3a 100644
--- a/apps/temp-community-forum/package.json
+++ b/apps/temp-community-forum/package.json
@@ -22,7 +22,6 @@
"@types/react": "17.0.37",
"config": "*",
"eslint": "7.32.0",
- "mini-svg-data-uri": "^1.4.4",
"next-transpile-modules": "9.0.0",
"tsconfig": "*",
"typescript": "^4.5.3"
diff --git a/apps/www/tailwind.config.js b/apps/www/tailwind.config.js
index 9c2af498997..66c96328173 100644
--- a/apps/www/tailwind.config.js
+++ b/apps/www/tailwind.config.js
@@ -1 +1,27 @@
-module.exports = require('config/tailwind.config')
+const config = require('config/tailwind.config')
+
+module.exports = config({
+ content: [
+ '../../packages/common/**/*.{ts,tsx}',
+ '../../packages/ui/**/*.{tsx,ts,js}',
+ './pages/**/*.{tsx,mdx}',
+ './components/**/*.tsx',
+ './layouts/**/*.tsx',
+ './src/**/*.{ts,tsx,mdx}',
+ './_blog/*.mdx',
+ ],
+ theme: {
+ extend: {
+ 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',
+ },
+ },
+ },
+})
diff --git a/package-lock.json b/package-lock.json
index e0d2dbdbd1a..17568b25374 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -38606,7 +38606,6 @@
"eslint-config-next": "^12.0.8",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-react": "7.28.0",
- "mini-svg-data-uri": "^1.4.4",
"tailwindcss-radix": "^2.0.0"
}
},
@@ -49845,7 +49844,6 @@
"eslint-config-next": "^12.0.8",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-react": "7.28.0",
- "mini-svg-data-uri": "^1.4.4",
"tailwindcss-radix": "^2.0.0"
},
"dependencies": {
diff --git a/packages/config/package.json b/packages/config/package.json
index 62e639d2cac..8825df50bd6 100644
--- a/packages/config/package.json
+++ b/packages/config/package.json
@@ -14,7 +14,6 @@
"eslint-config-next": "^12.0.8",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-react": "7.28.0",
- "mini-svg-data-uri": "^1.4.4",
"tailwindcss-radix": "^2.0.0",
"@tailwindcss/typography": "^0.5.2"
}
diff --git a/packages/config/tailwind.config.js b/packages/config/tailwind.config.js
index f5b73b9fb55..31f9da9cd5d 100644
--- a/packages/config/tailwind.config.js
+++ b/packages/config/tailwind.config.js
@@ -1,7 +1,6 @@
const ui = require('./ui.config.js')
-const svgToDataUri = require('mini-svg-data-uri')
+const deepMerge = require('deepmerge')
-const twConfigRef = require('./tw-config-ref')
const color = require('./../ui/styles/tw-extend/color')
function generateTwColorClasses(globalKey, twAttributes) {
@@ -20,17 +19,6 @@ function generateTwColorClasses(globalKey, twAttributes) {
const uiConfig = ui({
mode: 'JIT',
- content: [
- '../../packages/common/**/*.{ts,tsx}',
- '../../packages/ui/**/*.{tsx,ts,js}',
- './src/**/*.{ts,tsx,mdx}',
- './components/**/*.tsx',
- './layouts/**/*.tsx',
- './pages/**/*.{tsx,mdx}',
- './docs/**/*.{tsx,mdx}',
- './_blog/*.mdx',
- // purge styles from supabase ui theme
- ],
darkMode: 'class',
theme: {
accentColor: (theme) => ({
@@ -252,62 +240,83 @@ const uiConfig = ui({
},
},
},
+ // used in auto docs
+ docs: {
+ css: {
+ '--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',
+ },
+ // '--tw-prose-invert-code': theme('colors.white'),
+ // '--tw-prose-invert-pre-code': theme('colors.scale[900]'),
+ // '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)',
+ // '--tw-prose-invert-th-borders': theme('colors.scale[600]'),
+ // '--tw-prose-invert-td-borders': theme('colors.scale[700]'),
+ },
+ },
}),
screens: {
xs: '480px',
},
fontFamily: {
- sans: ['custom-font', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif'],
+ sans: ['Circular', 'custom-font', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif'],
mono: ['Office Code Pro', 'Source Code Pro', 'Menlo', 'monospace'],
},
- 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',
- },
},
},
- 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',
- },
- })
- },
- ],
})
+function arrayMergeFn(destinationArray, sourceArray) {
+ return destinationArray.concat(sourceArray).reduce((acc, cur) => {
+ if (acc.includes(cur)) return acc
+ return [...acc, cur]
+ }, [])
+}
+
/**
* 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, {
+ // let purge
+ // if (Array.isArray(tailwindConfig.purge)) {
+ // purge = {
+ // content: tailwindConfig.purge,
+ // }
+ // } else {
+ // purge = tailwindConfig.purge
+ // }
+ return deepMerge({ ...tailwindConfig }, uiConfig, {
arrayMerge: arrayMergeFn,
})
}
diff --git a/packages/ui/src/components/Popover/Popover.module.css b/packages/ui/src/components/Popover/Popover.module.css
index 9ae30064daa..97e8d4fabd7 100644
--- a/packages/ui/src/components/Popover/Popover.module.css
+++ b/packages/ui/src/components/Popover/Popover.module.css
@@ -1,5 +1,5 @@
.sbui-popover__content {
- @apply bg-bg-primary-light dark:bg-bg-secondary-dark p-0;
+ @apply bg-scale-200 p-0;
@apply border;
@apply rounded;
@apply shadow;
@@ -46,7 +46,7 @@
} */
.sbui-popover__arrow {
- @apply fill-current text-bg-primary-light dark:text-bg-secondary-dark;
+ @apply fill-current text-scale-200;
@apply border-0 border-t;
border-style: solid;
}
diff --git a/packages/ui/ui.config.js b/packages/ui/ui.config.js
deleted file mode 100644
index 63219022ff1..00000000000
--- a/packages/ui/ui.config.js
+++ /dev/null
@@ -1,399 +0,0 @@
-const deepMerge = require('deepmerge')
-const forms = require('@tailwindcss/forms')
-const plugin = require('tailwindcss/plugin')
-const radixUiColors = require('@radix-ui/colors')
-const brandColors = require('./default-colors')
-
-const { default: flattenColorPalette } = require('tailwindcss/lib/util/flattenColorPalette')
-
-// console.log(Object.keys(radixUiColors))
-
-// generates fixed scales
-// based on the root/light mode version
-const fixedOptions = ['scale', 'scaleA', 'brand']
-
-function radixColorKeys() {
- let keys = Object.keys(radixUiColors)
-
- /**
- * Filter array items based on search criteria (query)
- */
- function filterItems(arr, query) {
- return arr.filter(function (el) {
- return el.toLowerCase().indexOf(query.toLowerCase()) == -1
- })
- }
-
- keys = filterItems(keys, 'Dark')
-
- // console.log('radixColorKeys', keys)
- return keys
-}
-
-function generateColorClasses() {
- const brandColors = ['brand', 'scale', 'scaleA']
- const colors = [...radixColorKeys(), ...brandColors]
-
- let mappedColors = {}
-
- // generate the shape of the colors object
- colors.map((x) => {
- // create empty obj for each color
- mappedColors[x] = {}
- // create empty obj for each fixed color
- if (
- fixedOptions.some(function (v) {
- return x.indexOf(v) >= 0
- })
- ) {
- mappedColors[`${x}-fixed`] = {}
- }
- })
-
- colors.map((x) => {
- for (let index = 0; index < 12; index++) {
- const step = index + 1
- mappedColors[x][step * 100] = `var(--colors-${x.toLowerCase()}${step})`
-
- if (
- fixedOptions.some(function (v) {
- return x.indexOf(v) >= 0
- })
- ) {
- // console.log(x)
- mappedColors[`${x}-fixed`][step * 100] = `var(--colors-fixed-${x}${step})`
- }
- }
- })
-
- return mappedColors
-}
-
-const colorClasses = generateColorClasses()
-
-/*
- * generateCssVariables()
- *
- * generate the CSS variables for tailwind to use
- *
- */
-
-function generateCssVariables() {
- // potential options
- // { fixedOptions, brandColors }
-
- let rootColors = {}
- let darkColors = {}
-
- const radixArray = Object.values(radixUiColors)
- const brandArray = Object.values(brandColors)
-
- function generateColors(colors, index, colorSet) {
- const key = Object.keys(colorSet)[index]
-
- if (key.includes('Dark')) {
- darkColors = { ...darkColors, ...colors }
- } else {
- rootColors = { ...rootColors, ...colors }
-
- // generate an optional 'fixed' scale of colors
- if (
- fixedOptions.some(function (v) {
- return key.indexOf(v) >= 0
- })
- ) {
- rootColors.fixed = { ...rootColors?.fixed, ...colors }
- }
- }
- }
-
- radixArray.map((x, i) => {
- generateColors(x, i, radixUiColors)
- })
-
- brandArray.map((x, i) => {
- generateColors(x, i, brandColors)
- })
-
- return {
- root: { ...rootColors },
- dark: { ...darkColors },
- }
-}
-
-const variables = generateCssVariables()
-
-const uiConfig = {
- theme: {
- variables: {
- DEFAULT: {
- width: {
- listbox: '320px',
- },
- colors: { ...variables.root },
- },
- '.dark': {
- colors: { ...variables.dark },
- },
- },
- extend: {
- // dropdown extensions
- transformOrigin: {
- // tailwind class for this is `origin-dropdown`
- dropdown: 'var(--radix-dropdown-menu-content-transform-origin)',
- popover: 'var(--radix-popover-menu-content-transform-origin);',
- },
- width: {
- listbox: 'var(--width-listbox);',
- },
- keyframes: {
- fadeIn: {
- '0%': { transform: 'scale(0.95)', opacity: 0 },
- '100%': { transform: 'scale(1)', opacity: 1 },
- },
- fadeOut: {
- '0%': { transform: 'scale(1)', opacity: 1 },
- '100%': { transform: 'scale(0.95)', opacity: 0 },
- },
- overlayContentShow: {
- '0%': { opacity: 0, transform: 'translate(0%, -2%) scale(.96)' },
- '100%': { opacity: 1, transform: 'translate(0%, 0%) scale(1)' },
- },
- overlayContentHide: {
- '0%': { opacity: 1, transform: 'translate(0%, 0%) scale(1)' },
- '100%': { opacity: 0, transform: 'translate(0%, -2%) scale(.96)' },
- },
- dropdownFadeIn: {
- '0%': { transform: 'scale(0.95)', opacity: 0 },
- '100%': { transform: 'scale(1)', opacity: 1 },
- },
- dropdownFadeOut: {
- '0%': { transform: 'scale(1)', opacity: 1 },
- '100%': { transform: 'scale(0.95)', opacity: 0 },
- },
- fadeInOverlayBg: {
- '0%': { opacity: 0 },
- '100%': { opacity: 0.75 },
- },
- fadeOutOverlayBg: {
- '0%': { opacity: 0.75 },
- '100%': { opacity: 0 },
- },
- slideDown: {
- '0%': { height: 0, opacity: 0 },
- '100%': {
- height: 'var(--radix-accordion-content-height)',
- opacity: 1,
- },
- },
- slideUp: {
- '0%': { height: 'var(--radix-accordion-content-height)', opacity: 1 },
- '100%': { height: 0, opacity: 0 },
- },
-
- slideDownNormal: {
- '0%': { height: 0, opacity: 0 },
- '100%': {
- height: 'inherit',
- opacity: 1,
- },
- },
- slideUpNormal: {
- '0%': { height: 'inherit', opacity: 1 },
- '100%': { height: 0, opacity: 0 },
- },
-
- panelSlideLeftOut: {
- '0%': { transform: 'translateX(-100%)', opacity: 0 },
- '100%': {
- transform: 'translate-x-0',
- opacity: 1,
- },
- },
- panelSlideLeftIn: {
- '0%': { transform: 'translate-x-0', opacity: 1 },
- '100%': { transform: 'translateX(-100%)', opacity: 0 },
- },
- panelSlideRightOut: {
- '0%': { transform: 'translateX(100%)', opacity: 0 },
- '100%': {
- transform: 'translate-x-0',
- opacity: 1,
- },
- },
- panelSlideRightIn: {
- '0%': { transform: 'translate-x-0', opacity: 1 },
- '100%': { transform: 'translateX(100%)', opacity: 0 },
- },
- },
- animation: {
- 'fade-in': 'fadeIn 300ms',
- 'fade-out': 'fadeOut 300ms',
-
- 'dropdown-content-show': 'overlayContentShow 100ms cubic-bezier(0.16, 1, 0.3, 1)',
- 'dropdown-content-hide': 'overlayContentHide 100ms cubic-bezier(0.16, 1, 0.3, 1)',
-
- 'overlay-show': 'overlayContentShow 300ms cubic-bezier(0.16, 1, 0.3, 1)',
- 'overlay-hide': 'overlayContentHide 300ms cubic-bezier(0.16, 1, 0.3, 1)',
-
- 'fade-in-overlay-bg': 'fadeInOverlayBg 300ms',
- 'fade-out-overlay-bg': 'fadeOutOverlayBg 300ms',
-
- 'slide-down': 'slideDown 300ms cubic-bezier(0.87, 0, 0.13, 1)',
- 'slide-up': 'slideUp 300ms cubic-bezier(0.87, 0, 0.13, 1)',
-
- 'slide-down-normal': 'slideDownNormal 300ms cubic-bezier(0.87, 0, 0.13, 1)',
- 'slide-up-normal': 'slideUpNormal 300ms cubic-bezier(0.87, 0, 0.13, 1)',
-
- 'panel-slide-left-out': 'panelSlideLeftOut 200ms cubic-bezier(0.87, 0, 0.13, 1)',
- 'panel-slide-left-in': 'panelSlideLeftIn 250ms cubic-bezier(0.87, 0, 0.13, 1)',
- 'panel-slide-right-out': 'panelSlideRightOut 200ms cubic-bezier(0.87, 0, 0.13, 1)',
- 'panel-slide-right-in': 'panelSlideRightIn 250ms cubic-bezier(0.87, 0, 0.13, 1)',
-
- // tailwind class for this is `animate-dropdownFadeIn`
- dropdownFadeIn: 'dropdownFadeIn 0.1s ease-out',
- // tailwind class for this is `animate-dropdownFadeOut`
- dropdownFadeOut: 'dropdownFadeOut 0.1s ease-out',
- },
- colors: {
- ...colorClasses,
- 'hi-contrast': `var(--colors-fixed-scale12)`,
- 'lo-contrast': `var(--colors-fixed-scale1)`,
- },
- },
- },
- plugins: [
- require('@mertasan/tailwindcss-variables'),
- function ({ addUtilities, addVariant }) {
- // addVariant('data-open', '&:[data-state=open]')
- addUtilities({
- ".dropdown-content[data-state='open']": {
- animation: 'fadeIn 50ms ease-out',
- },
- ".dropdown-content[data-state='closed']": {
- animation: 'fadeOut 50ms ease-in',
- },
-
- "[data-state='open'] .accordion-content-animation": {
- animation: 'slideDown 200ms ease-out',
- },
- "[data-state='closed'] .accordion-content-animation": {
- animation: 'slideUp 200ms ease-in',
- },
- '.text-code': {
- margin: '0 0.2em',
- padding: '0.2em 0.4em 0.1em',
- background: 'hsla(0, 0%, 58.8%, 0.1)',
- border: '1px solid hsla(0, 0%, 39.2%, 0.2)',
- borderRadius: '3px',
- },
- '.no-scrollbar': {
- /* Hide scrollbar for IE, Edge*/
- '-ms-overflow-style': 'none',
-
- /* Firefox */
- 'scrollbar-width': 'none' /* Firefox */,
-
- /* Hide scrollbar for Chrome, Safari and Opera */
- '&::-webkit-scrollbar': {
- display: 'none',
- },
- },
- /* Add fadeout effect */
- '.mask-fadeout-right': {
- '-webkit-mask-image': 'linear-gradient(to right, white 98%, transparent 100%)',
- 'mask-image': 'linear-gradient(to right, white 98%, transparent 100%)',
- },
- '.mask-fadeout-left': {
- '-webkit-mask-image': 'linear-gradient(to left, white 98%, transparent 100%)',
- 'mask-image': 'linear-gradient(to left, white 98%, transparent 100%)',
- },
- 'input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button':
- {
- '-webkit-appearance': 'none',
- margin: '0',
- },
- })
- addVariant('data-open-parent', '[data-state="open"] &')
- addVariant('data-closed-parent', '[data-state="closed"] &')
- addVariant('data-open', '&[data-state="open"]')
- addVariant('data-closed', '&[data-state="closed"]')
- addVariant('data-show', '&[data-state="show"]')
- addVariant('data-hide', '&[data-state="hide"]')
- addVariant('data-checked', '&[data-state="checked"]')
- addVariant('data-unchecked', '&[data-state="unchecked"]')
- addVariant('aria-expanded', '&[aria-expanded="true"]')
- // addVariant('parent-data-open', '[data-state="open"]&')
- },
- function ({ matchUtilities, theme }) {
- matchUtilities(
- {
- highlight: (value) => ({ boxShadow: `inset 0 1px 0 0 ${value}` }),
- },
- { values: flattenColorPalette(theme('backgroundColor')), type: 'color' }
- ),
- matchUtilities(
- {
- subhighlight: (value) => ({
- boxShadow: `inset 0 -1px 0 0 ${value}`,
- }),
- },
- {
- values: flattenColorPalette(theme('backgroundColor')),
- type: 'color',
- }
- ),
- matchUtilities(
- {
- bordershadow: (value) => {
- return {
- boxShadow: `
- var(--colors-blacka1) 0px 0px 0px 0px,
- var(--colors-blacka1) 0px 0px 0px 0px,
- var(--colors-blacka8) 0px 1px 1px 0px,
- ${value} 0px 0px 0px 1px,
- var(--colors-blacka1) 0px 0px 0px 0px,
- var(--colors-blacka1) 0px 0px 0px 0px,
- rgb(64 68 82 / 8%) 0px 2px 5px 0px;
- `,
- }
- },
- },
- {
- values: flattenColorPalette(theme('backgroundColor')),
- type: 'color',
- }
- )
- },
- require('tailwindcss-radix')(),
- forms,
- ],
-}
-
-function arrayMergeFn(destinationArray, sourceArray) {
- return destinationArray.concat(sourceArray).reduce((acc, cur) => {
- if (acc.includes(cur)) return acc
- return [...acc, cur]
- }, [])
-}
-
-/**
- * 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
diff --git a/studio/components/interfaces/App/PortalToast.tsx b/studio/components/interfaces/App/PortalToast.tsx
index de8d70b2e01..c2282252893 100644
--- a/studio/components/interfaces/App/PortalToast.tsx
+++ b/studio/components/interfaces/App/PortalToast.tsx
@@ -15,7 +15,7 @@ const PortalToast = () => (
position="top-right"
toastOptions={{
className:
- 'bg-bg-primary-light dark:bg-bg-primary-dark text-typography-body-strong-light dark:text-typography-body-strong-dark border dark:border-dark !max-w-[380px]',
+ 'bg-scale-200 text-typography-body-strong-light dark:text-typography-body-strong-dark border dark:border-dark !max-w-[380px]',
style: {
padding: '8px',
paddingLeft: '16px',
diff --git a/studio/components/interfaces/Database/Functions/CreateFunction.tsx b/studio/components/interfaces/Database/Functions/CreateFunction.tsx
index 80e780b289a..bfb89fac1ea 100644
--- a/studio/components/interfaces/Database/Functions/CreateFunction.tsx
+++ b/studio/components/interfaces/Database/Functions/CreateFunction.tsx
@@ -406,7 +406,7 @@ const CreateFunction: FC<CreateFunctionProps> = ({ func, visible, setVisible })
<SidePanel.Separator />
<SidePanel.Content>
<Panel>
- <div className={`space-y-8 rounded bg-bg-alt-light py-4 dark:bg-bg-alt-dark`}>
+ <div className={`space-y-8 rounded bg-scale-200 py-4`}>
<div className={`px-6`}>
<Toggle
onChange={() => _localState.toggleAdvancedVisible()}
diff --git a/studio/components/interfaces/Database/Triggers/ChooseFunctionForm.tsx b/studio/components/interfaces/Database/Triggers/ChooseFunctionForm.tsx
index 8c67c3367d9..25dff4a33de 100644
--- a/studio/components/interfaces/Database/Triggers/ChooseFunctionForm.tsx
+++ b/studio/components/interfaces/Database/Triggers/ChooseFunctionForm.tsx
@@ -157,7 +157,7 @@ const Function: FC<FunctionProps> = ({ id, completeStatement, name, onClick }) =
const [visible, setVisible] = useState(false)
return (
<div
- className="cursor-pointer rounded p-3 px-6 hover:bg-bg-alt-light dark:hover:bg-bg-alt-dark"
+ className="cursor-pointer rounded p-3 px-6 hover:bg-scale-200 dark:hover:bg-scale-200"
onClick={() => onClick(id)}
>
<div className="flex items-center justify-between space-x-3">
diff --git a/studio/components/interfaces/Home/ProjectList/PausedProjectCard.tsx b/studio/components/interfaces/Home/ProjectList/PausedProjectCard.tsx
index 0f1b9448fd0..1657583775c 100644
--- a/studio/components/interfaces/Home/ProjectList/PausedProjectCard.tsx
+++ b/studio/components/interfaces/Home/ProjectList/PausedProjectCard.tsx
@@ -20,9 +20,9 @@ const PausedProjectCard: FC<Props> = ({
<div
className={[
'bg-panel-header-light dark:bg-panel-header-dark',
- 'hover:bg-bg-alt-light dark:hover:bg-bg-alt-dark',
- 'border border-border-secondary-light dark:border-border-secondary-dark',
- 'hover:border-border-secondary-hover-light dark:hover:border-border-secondary-hover-dark',
+ 'hover:bg-scale-200 dark:hover:bg-scale-200',
+ 'border border-scale-700',
+ 'hover:border-scale-900',
'h-32 rounded p-4',
'flex flex-col justify-between transition duration-150 ease-in-out',
].join(' ')}
diff --git a/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx b/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx
index f9e5e0b40ed..fe985dfc60c 100644
--- a/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx
+++ b/studio/components/interfaces/Organization/TeamSettings/MembersView.tsx
@@ -142,7 +142,7 @@ const MembersView = ({ searchString, roles, members }: MembersViewProps) => {
<div className="flex items-center space-x-4">
<div>
{x.invited_id ? (
- <span className="flex p-2 border-2 rounded-full border-border-secondary-light dark:border-border-secondary-dark">
+ <span className="flex p-2 border-2 rounded-full border-scale-700">
<IconUser size={20} strokeWidth={2} />
</span>
) : isEmailUser ? (
diff --git a/studio/components/interfaces/Settings/API/JWTSettings.tsx b/studio/components/interfaces/Settings/API/JWTSettings.tsx
index f05341b37cf..71c0453f2d1 100644
--- a/studio/components/interfaces/Settings/API/JWTSettings.tsx
+++ b/studio/components/interfaces/Settings/API/JWTSettings.tsx
@@ -131,7 +131,7 @@ const JWTSettings: FC<Props> = ({}) => {
layout="horizontal"
/>
<div className="space-y-3">
- <div className="p-3 px-6 border rounded-md shadow-sm bg-bg-alt-light dark:border-dark dark:bg-bg-alt-dark">
+ <div className="p-3 px-6 border rounded-md shadow-sm bg-scale-200 dark:border-dark dark:bg-scale-200">
{isUpdatingJwtSecret ? (
<div className="flex items-center space-x-2">
<IconLoader className="animate-spin" size={14} />
diff --git a/studio/components/layouts/AccountLayout/WithSidebar.tsx b/studio/components/layouts/AccountLayout/WithSidebar.tsx
index b3602691bfc..8c7e29e91ac 100644
--- a/studio/components/layouts/AccountLayout/WithSidebar.tsx
+++ b/studio/components/layouts/AccountLayout/WithSidebar.tsx
@@ -49,7 +49,7 @@ const WithSidebar: FC<Props> = ({
id="with-sidebar"
style={{ height: maxHeight, maxHeight }}
className={[
- 'h-full bg-sidebar-linkbar-light dark:bg-sidebar-linkbar-dark',
+ 'h-full bg-scale-200',
'hide-scrollbar w-64 overflow-auto border-r dark:border-dark',
].join(' ')}
>
diff --git a/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsx b/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsx
index 913d8d9010d..569189936fc 100644
--- a/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsx
+++ b/studio/components/layouts/ProjectLayout/NavigationBar/NavigationBar.tsx
@@ -35,7 +35,7 @@ const NavigationBar: FC<Props> = ({}) => {
style={{ height: ongoingIncident ? 'calc(100vh - 44px)' : '100vh' }}
className={[
'flex w-14 flex-col justify-between overflow-y-hidden p-2',
- 'border-r bg-sidebar-light dark:border-dark dark:bg-sidebar-dark',
+ 'border-r bg-scale-200 dark:border-dark dark:bg-sidebar-dark',
].join(' ')}
>
<ul className="flex flex-col space-y-2">
diff --git a/studio/components/layouts/ProjectLayout/ProductMenuBar.tsx b/studio/components/layouts/ProjectLayout/ProductMenuBar.tsx
index 4e08db436cf..aac652b82f0 100644
--- a/studio/components/layouts/ProjectLayout/ProductMenuBar.tsx
+++ b/studio/components/layouts/ProjectLayout/ProductMenuBar.tsx
@@ -15,8 +15,8 @@ const ProductMenuBar: FC<Props> = ({ title, children }) => {
style={{ height: maxHeight, maxHeight }}
className={[
'hide-scrollbar flex w-64 flex-col border-r', // Layout
- 'bg-sidebar-linkbar-light', // Light mode
- 'dark:bg-sidebar-linkbar-dark dark:border-dark ', // Dark mode
+ 'bg-scale-200', // Light mode
+ 'dark:border-dark ', // Dark mode
].join(' ')}
>
<div
diff --git a/studio/components/to-be-cleaned/Storage/StorageExplorer/StorageExplorer.js b/studio/components/to-be-cleaned/Storage/StorageExplorer/StorageExplorer.js
index b31a2d8f792..d07c4eaa3d2 100644
--- a/studio/components/to-be-cleaned/Storage/StorageExplorer/StorageExplorer.js
+++ b/studio/components/to-be-cleaned/Storage/StorageExplorer/StorageExplorer.js
@@ -154,7 +154,7 @@ const StorageExplorer = observer(({ bucket }) => {
<div
ref={storageExplorerRef}
className="
- bg-bg-primary-light dark:bg-bg-primary-dark
+ bg-scale-200
border-panel-border-light dark:border-panel-border-dark flex
h-full w-full flex-col rounded-md border"
>
diff --git a/studio/components/ui/PasswordStrengthBar.tsx b/studio/components/ui/PasswordStrengthBar.tsx
index c262bff2118..2c472fad53a 100644
--- a/studio/components/ui/PasswordStrengthBar.tsx
+++ b/studio/components/ui/PasswordStrengthBar.tsx
@@ -26,7 +26,7 @@ const PasswordStrengthBar = ({
aria-valuenow={(PASSWORD_STRENGTH_PERCENTAGE as any)[passwordStrengthScore]}
aria-valuetext={(PASSWORD_STRENGTH_PERCENTAGE as any)[passwordStrengthScore]}
role="progressbar"
- className="mb-2 overflow-hidden transition-all border rounded bg-bg-alt-light dark:bg-bg-alt-dark dark:border-dark"
+ className="mb-2 overflow-hidden transition-all border rounded bg-scale-200 dark:bg-scale-200 dark:border-dark"
>
<div
style={{
diff --git a/studio/pages/vercel/integrate.tsx b/studio/pages/vercel/integrate.tsx
index f986fdd8174..3e29988919d 100644
--- a/studio/pages/vercel/integrate.tsx
+++ b/studio/pages/vercel/integrate.tsx
@@ -280,8 +280,8 @@ const IntegrationProject: FC = observer(() => {
</Select>
</div>
<div
- className="w-full rounded-sm border border-border-secondary-light
- bg-panel-header-light dark:border-border-secondary-dark dark:bg-panel-header-dark"
+ className="w-full rounded-sm border border-scale-700
+ bg-panel-header-light dark:bg-panel-header-dark"
>
<div className="flex items-center justify-between p-6">
<h4 className="my-auto mr-8 text-lg capitalize">{name}</h4>
diff --git a/studio/styles/main.scss b/studio/styles/main.scss
index e3d187c24c4..af41a26df17 100644
--- a/studio/styles/main.scss
+++ b/studio/styles/main.scss
@@ -26,7 +26,7 @@ body,
margin: 0;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
- @apply bg-bg-primary-light dark:bg-bg-primary-dark;
+ @apply bg-scale-200;
@apply text-scale-1200;
}
@@ -236,4 +236,4 @@ div.fixed.inset-0 {
input {
@apply pr-7;
}
-}
\ No newline at end of file
+}
diff --git a/studio/styles/ui.scss b/studio/styles/ui.scss
index 891b2a0bb7d..2c5d52c3de0 100644
--- a/studio/styles/ui.scss
+++ b/studio/styles/ui.scss
@@ -192,20 +192,12 @@
/* Docs */
.Docs {
&--inner-wrapper {
- background: linear-gradient(
- 90deg,
- var(--colors-scale1) 50%,
- var(--colors-scale3) 50%
- ); /* bg-white bg-coolGray-100 */
+ background: linear-gradient(90deg, var(--colors-scale1) 50%, var(--colors-scale3) 50%);
width: 100%;
}
.dark &--inner-wrapper {
- background: linear-gradient(
- 90deg,
- var(--colors-scale3) 50%,
- var(--colors-scale2) 50%
- ); /* bg-gray-700 bg-gray-600 */
+ background: linear-gradient(90deg, var(--colors-scale3) 50%, var(--colors-scale2) 50%);
}
// h1,
diff --git a/studio/tailwind.config-old.js b/studio/tailwind.config-old.js
new file mode 100644
index 00000000000..ba3c0c58955
--- /dev/null
+++ b/studio/tailwind.config-old.js
@@ -0,0 +1,429 @@
+const { repeat } = require('lodash')
+const ui = require('../packages/config/ui.config.js')
+
+const blueGray = {
+ 50: '#F8FAFC',
+ 100: '#F1F5F9',
+ 200: '#E2E8F0',
+ 300: '#CBD5E1',
+ 400: '#94A3B8',
+ 500: '#64748B',
+ 600: '#475569',
+ 700: '#334155',
+ 800: '#1E293B',
+ 900: '#0F172A',
+}
+
+const coolGray = {
+ 50: '#F9FAFB',
+ 100: '#F3F4F6',
+ 200: '#E5E7EB',
+ 300: '#D1D5DB',
+ 400: '#9CA3AF',
+ 500: '#6B7280',
+ 600: '#4B5563',
+ 700: '#374151',
+ 800: '#1F2937',
+ 900: '#111827',
+}
+
+module.exports = ui({
+ darkMode: 'class', // or 'media' or 'class'
+ content: [
+ // purge styles from app
+ './pages/**/*.{js,ts,jsx,tsx}',
+ './components/**/*.{js,ts,jsx,tsx}',
+ './internals/**/*.{js,ts,jsx,tsx}',
+ './lib/**/*.{js,ts,jsx,tsx}',
+ './lib/**/**/*.{js,ts,jsx,tsx}',
+ './../packages/ui/src/lib/theme/defaultTheme.ts',
+ // purge styles from supabase ui theme
+ // './../node_modules/ui/dist/config/default-theme.js',
+ // purge styles from grid library
+ './../node_modules/@supabase/grid/src/components/**/*.{js,ts,jsx,tsx}',
+ './../node_modules/@supabase/grid/src/components/**/**/*.{js,ts,jsx,tsx}',
+ ],
+ theme: {
+ // maxHeight: {
+ // 12: '3rem',
+ // 48: '12rem',
+ // },
+ borderColor: (theme) => ({
+ ...theme('colors'),
+ DEFAULT: 'var(--colors-scale5)',
+ dark: 'var(--colors-scale4)',
+ }),
+ divideColor: (theme) => ({
+ ...theme('colors'),
+ DEFAULT: 'var(--colors-scale6)',
+ dark: 'var(--colors-scale2)',
+ }),
+ extend: {
+ transitionProperty: {
+ height: 'height',
+ },
+ 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.scale[1100]'),
+ '--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',
+ },
+ pre: {
+ background: 'none',
+ padding: 0,
+ marginBottom: '32px',
+ },
+ ul: {
+ listStyleType: 'none',
+ paddingLeft: '1rem',
+ },
+ 'ul li': {
+ position: 'relative',
+ },
+ 'ul li::before': {
+ position: 'absolute',
+ top: '0.75rem',
+ left: '-1rem',
+ height: '0.125rem',
+ width: '0.5rem',
+ borderRadius: '0.25rem',
+ backgroundColor: 'var(--colors-scale7)',
+ content: '""',
+ },
+ ol: {
+ paddingLeft: '1rem',
+ counterReset: 'item',
+ listStyleType: 'none',
+ },
+ 'ol li': { display: 'block', position: 'relative', paddingLeft: '1rem' },
+ 'ol li::before': {
+ position: 'absolute',
+ top: '0.25rem',
+ left: '-1rem',
+ height: '1.2rem',
+ width: '1.2rem',
+ borderRadius: '0.25rem',
+ backgroundColor: 'var(--colors-scale3)',
+ border: '1px solid var(--colors-scale5)',
+ content: 'counter(item) " "',
+ counterIncrement: 'item',
+ fontSize: '12px',
+ color: 'var(--colors-scale9)',
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ },
+
+ 'p img': {
+ border: '1px solid var(--colors-scale4)',
+ borderRadius: '4px',
+ overflow: 'hidden',
+ },
+ iframe: {
+ border: '1px solid ' + theme('borderColor.DEFAULT'),
+ borderRadius: theme('borderRadius.lg'),
+ },
+ td: {
+ borderBottom: '1px solid ' + theme('colors.scale[400]'),
+ },
+ code: {
+ fontWeight: '400',
+ padding: '0.2rem 0.4rem',
+ backgroundColor: theme('colors.scale[400]'),
+ border: '1px solid ' + theme('colors.scale[500]'),
+ borderRadius: theme('borderRadius.lg'),
+ wordBreak: 'break-all',
+ },
+ a: {
+ position: 'relative',
+ transition: 'color 0.3s ease-in-out',
+ paddingBottom: '2px',
+ fontWeight: '400',
+ color: 'var(--colors-scale12)',
+ textDecorationLine: 'underline',
+ textDecorationColor: 'var(--colors-brand7)',
+ textDecorationThickness: '1px',
+ textUnderlineOffset: '4px',
+ },
+ 'a:hover': {
+ textDecorationColor: 'var(--colors-brand9)',
+ },
+ },
+ },
+ docs: {
+ css: {
+ '--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',
+ },
+ // '--tw-prose-invert-code': theme('colors.white'),
+ // '--tw-prose-invert-pre-code': theme('colors.scale[900]'),
+ // '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)',
+ // '--tw-prose-invert-th-borders': theme('colors.scale[600]'),
+ // '--tw-prose-invert-td-borders': theme('colors.scale[700]'),
+ },
+ },
+ }),
+ fontSize: {
+ grid: '13px',
+ },
+ gridTemplateColumns: {
+ billingWithTeam: 'repeat(3, minmax(0, 1fr)) 0.9fr',
+ },
+ colors: {
+ // gray: { ...gray },
+ // green: { ...green },
+ blueGray: { ...blueGray },
+ coolGray: { ...coolGray },
+
+ /* typography */
+ 'typography-body': {
+ light: 'var(--colors-scale11)',
+ dark: 'var(--colors-scale11)',
+ },
+ 'typography-body-secondary': {
+ light: 'var(--colors-scale10)',
+ dark: 'var(--colors-scale10)',
+ },
+ 'typography-body-strong': {
+ light: 'var(--colors-scale12)',
+ dark: 'var(--colors-scale12)',
+ },
+ 'typography-body-faded': {
+ light: 'var(--colors-scale9)',
+ dark: 'var(--colors-scale9)',
+ },
+
+ /* Nav */
+ sidebar: {
+ // light: 'white',
+ // dark: gray[800],
+ light: 'var(--colors-scale2)',
+ dark: 'var(--colors-scale2)',
+ },
+ 'sidebar-linkbar': {
+ // light: 'white',
+ // dark: gray[800],
+ light: 'var(--colors-scale2)',
+ dark: 'var(--colors-scale2)',
+ },
+ // 'sidebar-active': {
+ // light: 'var(--colors-scale12)',
+ // dark: 'var(--colors-scale2)',
+ // // dark: gray[700],
+ // },
+
+ /* borders */
+ 'border-secondary': {
+ light: 'var(--colors-scale7)',
+ dark: 'var(--colors-scale7)',
+ },
+ 'border-secondary-hover': {
+ light: 'var(--colors-scale9)',
+ dark: 'var(--colors-scale9)',
+ },
+
+ /* app backgrounds */
+ 'bg-primary': {
+ light: 'var(--colors-scale2)',
+ dark: 'var(--colors-scale2)',
+ },
+ 'bg-secondary': {
+ // light: blueGray[100],
+ // dark: gray[700],
+ light: 'var(--colors-scale2)',
+ dark: 'var(--colors-scale2)',
+ },
+ 'bg-alt': {
+ // light: blueGray[50], // gray[100],
+ // dark: gray[600],
+ light: 'var(--colors-scale2)',
+ dark: 'var(--colors-scale2)',
+ },
+
+ /* Tables */
+ 'table-body': {
+ light: 'var(--colors-scale1)',
+ dark: 'var(--colors-scale2)',
+ },
+ 'table-header': {
+ light: 'var(--colors-scale2)', // gray[100],
+ dark: 'var(--colors-scale3)', // '#1a1a1a', //gray[700],
+ },
+ 'table-footer': {
+ light: 'var(--colors-scale2)', // gray[100],
+ dark: 'var(--colors-scale4)', // '#1a1a1a',
+ },
+ 'table-border': {
+ light: 'var(--colors-scale5)', // gray[100],
+ dark: 'var(--colors-scale4)', // '#1a1a1a',
+ },
+
+ /* Panels */
+ 'panel-body': {
+ light: 'var(--colors-scale1)',
+ dark: 'var(--colors-scale3)',
+ },
+ 'panel-header': {
+ light: 'var(--colors-scale1)',
+ dark: 'var(--colors-scale3)',
+ },
+ 'panel-footer': {
+ light: 'var(--colors-scale1)',
+ dark: 'var(--colors-scale3)',
+ },
+ 'panel-border': {
+ light: 'var(--colors-scale5)',
+ dark: 'var(--colors-scale4)',
+ },
+ 'panel-border-interior': {
+ light: 'var(--colors-scale4)',
+ dark: 'var(--colors-scale4)',
+ },
+ 'panel-border-hover': {
+ light: 'var(--colors-scale2)',
+ dark: 'var(--colors-scale4)',
+ },
+
+ /*
+ Forms
+ */
+ // form: {
+ // light: coolGray[600],
+ // dark: gray[200],
+ // },
+
+ // 'input-placeholder': {
+ // light: coolGray[300],
+ // dark: gray[400],
+ // },
+ // 'input-value': {
+ // light: coolGray[600],
+ // dark: gray[200],
+ // },
+ // 'input-border': {
+ // light: coolGray[300],
+ // dark: gray[500],
+ // },
+ // 'input-label': {
+ // light: coolGray[600],
+ // dark: gray[200],
+ // },
+ // 'input-border-hover': {
+ // light: coolGray[400],
+ // dark: gray[400],
+ // },
+ // 'input-border-focus': {
+ // light: green[300],
+ // dark: green[300],
+ // },
+ },
+ animation: {
+ shimmer: 'shimmer 2s infinite linear',
+ sway: 'sway 3s cubic-bezier(0.4, 0, 0.6, 1) infinite',
+ },
+ keyframes: {
+ shimmer: {
+ '0%': {
+ 'background-position': '-1000px 0',
+ },
+ '100%': {
+ 'background-position': '1000px 0',
+ },
+ },
+ sway: {
+ '0%, 100%': {
+ transform: 'rotate(-10deg) scale(1.5) translateY(4rem)',
+ },
+ '50%': {
+ transform: 'rotate(10deg) scale(1.5) translateY(2rem)',
+ },
+ },
+ },
+ },
+ fontFamily: {
+ sans: ['circular', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif'],
+ mono: ['source code pro', 'Menlo', 'monospace'],
+ },
+ },
+ variants: {
+ extend: {},
+ },
+ plugins: [
+ require('@tailwindcss/typography'),
+ // ...
+ ],
+})
diff --git a/studio/tailwind.config.js b/studio/tailwind.config.js
index 42d8f6c8553..34173c5bd8c 100644
--- a/studio/tailwind.config.js
+++ b/studio/tailwind.config.js
@@ -1,254 +1,23 @@
-const { repeat } = require('lodash')
-const ui = require('./../packages/config/ui.config.js')
+const config = require('config/tailwind.config')
-const blueGray = {
- 50: '#F8FAFC',
- 100: '#F1F5F9',
- 200: '#E2E8F0',
- 300: '#CBD5E1',
- 400: '#94A3B8',
- 500: '#64748B',
- 600: '#475569',
- 700: '#334155',
- 800: '#1E293B',
- 900: '#0F172A',
-}
-
-const coolGray = {
- 50: '#F9FAFB',
- 100: '#F3F4F6',
- 200: '#E5E7EB',
- 300: '#D1D5DB',
- 400: '#9CA3AF',
- 500: '#6B7280',
- 600: '#4B5563',
- 700: '#374151',
- 800: '#1F2937',
- 900: '#111827',
-}
-
-module.exports = ui({
- darkMode: 'class', // or 'media' or 'class'
+module.exports = config({
content: [
- // purge styles from app
+ './../packages/common/**/*.{ts,tsx}',
+ './../packages/ui/**/*.{tsx,ts,js}',
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
- './internals/**/*.{js,ts,jsx,tsx}',
'./lib/**/*.{js,ts,jsx,tsx}',
'./lib/**/**/*.{js,ts,jsx,tsx}',
- './../packages/ui/src/lib/theme/defaultTheme.ts',
- // purge styles from supabase ui theme
- // './../node_modules/ui/dist/config/default-theme.js',
- // purge styles from grid library
'./../node_modules/@supabase/grid/src/components/**/*.{js,ts,jsx,tsx}',
'./../node_modules/@supabase/grid/src/components/**/**/*.{js,ts,jsx,tsx}',
+ './internals/**/*.{js,ts,jsx,tsx}',
],
theme: {
- // maxHeight: {
- // 12: '3rem',
- // 48: '12rem',
- // },
- borderColor: (theme) => ({
- ...theme('colors'),
- DEFAULT: 'var(--colors-scale5)',
- dark: 'var(--colors-scale4)',
- }),
- divideColor: (theme) => ({
- ...theme('colors'),
- DEFAULT: 'var(--colors-scale6)',
- dark: 'var(--colors-scale2)',
- }),
extend: {
- transitionProperty: {
- height: 'height',
- },
- 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.scale[1100]'),
- '--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',
- },
- pre: {
- background: 'none',
- padding: 0,
- marginBottom: '32px',
- },
- ul: {
- listStyleType: 'none',
- paddingLeft: '1rem',
- },
- 'ul li': {
- position: 'relative',
- },
- 'ul li::before': {
- position: 'absolute',
- top: '0.75rem',
- left: '-1rem',
- height: '0.125rem',
- width: '0.5rem',
- borderRadius: '0.25rem',
- backgroundColor: 'var(--colors-scale7)',
- content: '""',
- },
- ol: {
- paddingLeft: '1rem',
- counterReset: 'item',
- listStyleType: 'none',
- },
- 'ol li': { display: 'block', position: 'relative', paddingLeft: '1rem' },
- 'ol li::before': {
- position: 'absolute',
- top: '0.25rem',
- left: '-1rem',
- height: '1.2rem',
- width: '1.2rem',
- borderRadius: '0.25rem',
- backgroundColor: 'var(--colors-scale3)',
- border: '1px solid var(--colors-scale5)',
- content: 'counter(item) " "',
- counterIncrement: 'item',
- fontSize: '12px',
- color: 'var(--colors-scale9)',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- },
-
- 'p img': {
- border: '1px solid var(--colors-scale4)',
- borderRadius: '4px',
- overflow: 'hidden',
- },
- iframe: {
- border: '1px solid ' + theme('borderColor.DEFAULT'),
- borderRadius: theme('borderRadius.lg'),
- },
- td: {
- borderBottom: '1px solid ' + theme('colors.scale[400]'),
- },
- code: {
- fontWeight: '400',
- padding: '0.2rem 0.4rem',
- backgroundColor: theme('colors.scale[400]'),
- border: '1px solid ' + theme('colors.scale[500]'),
- borderRadius: theme('borderRadius.lg'),
- wordBreak: 'break-all',
- },
- a: {
- position: 'relative',
- transition: 'color 0.3s ease-in-out',
- paddingBottom: '2px',
- fontWeight: '400',
- color: 'var(--colors-scale12)',
- textDecorationLine: 'underline',
- textDecorationColor: 'var(--colors-brand7)',
- textDecorationThickness: '1px',
- textUnderlineOffset: '4px',
- },
- 'a:hover': {
- textDecorationColor: 'var(--colors-brand9)',
- },
- },
- },
- docs: {
- css: {
- '--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',
- },
- // '--tw-prose-invert-code': theme('colors.white'),
- // '--tw-prose-invert-pre-code': theme('colors.scale[900]'),
- // '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)',
- // '--tw-prose-invert-th-borders': theme('colors.scale[600]'),
- // '--tw-prose-invert-td-borders': theme('colors.scale[700]'),
- },
- },
- }),
fontSize: {
grid: '13px',
},
- gridTemplateColumns: {
- billingWithTeam: 'repeat(3, minmax(0, 1fr)) 0.9fr',
- },
colors: {
- // gray: { ...gray },
- // green: { ...green },
- blueGray: { ...blueGray },
- coolGray: { ...coolGray },
-
/* typography */
'typography-body': {
light: 'var(--colors-scale11)',
@@ -267,53 +36,6 @@ module.exports = ui({
dark: 'var(--colors-scale9)',
},
- /* Nav */
- sidebar: {
- // light: 'white',
- // dark: gray[800],
- light: 'var(--colors-scale2)',
- dark: 'var(--colors-scale2)',
- },
- 'sidebar-linkbar': {
- // light: 'white',
- // dark: gray[800],
- light: 'var(--colors-scale2)',
- dark: 'var(--colors-scale2)',
- },
- // 'sidebar-active': {
- // light: 'var(--colors-scale12)',
- // dark: 'var(--colors-scale2)',
- // // dark: gray[700],
- // },
-
- /* borders */
- 'border-secondary': {
- light: 'var(--colors-scale7)',
- dark: 'var(--colors-scale7)',
- },
- 'border-secondary-hover': {
- light: 'var(--colors-scale9)',
- dark: 'var(--colors-scale9)',
- },
-
- /* app backgrounds */
- 'bg-primary': {
- light: 'var(--colors-scale2)',
- dark: 'var(--colors-scale2)',
- },
- 'bg-secondary': {
- // light: blueGray[100],
- // dark: gray[700],
- light: 'var(--colors-scale2)',
- dark: 'var(--colors-scale2)',
- },
- 'bg-alt': {
- // light: blueGray[50], // gray[100],
- // dark: gray[600],
- light: 'var(--colors-scale2)',
- dark: 'var(--colors-scale2)',
- },
-
/* Tables */
'table-body': {
light: 'var(--colors-scale1)',
@@ -357,40 +79,8 @@ module.exports = ui({
light: 'var(--colors-scale2)',
dark: 'var(--colors-scale4)',
},
-
- /*
- Forms
- */
- // form: {
- // light: coolGray[600],
- // dark: gray[200],
- // },
-
- // 'input-placeholder': {
- // light: coolGray[300],
- // dark: gray[400],
- // },
- // 'input-value': {
- // light: coolGray[600],
- // dark: gray[200],
- // },
- // 'input-border': {
- // light: coolGray[300],
- // dark: gray[500],
- // },
- // 'input-label': {
- // light: coolGray[600],
- // dark: gray[200],
- // },
- // 'input-border-hover': {
- // light: coolGray[400],
- // dark: gray[400],
- // },
- // 'input-border-focus': {
- // light: green[300],
- // dark: green[300],
- // },
},
+
animation: {
shimmer: 'shimmer 2s infinite linear',
sway: 'sway 3s cubic-bezier(0.4, 0, 0.6, 1) infinite',
@@ -414,16 +104,5 @@ module.exports = ui({
},
},
},
- fontFamily: {
- sans: ['circular', 'Helvetica Neue', 'Helvetica', 'Arial', 'sans-serif'],
- mono: ['source code pro', 'Menlo', 'monospace'],
- },
},
- variants: {
- extend: {},
- },
- plugins: [
- require('@tailwindcss/typography'),
- // ...
- ],
})