Files
supabase/apps/studio/tailwind.config.ts
Alaister Young f8183479e7 chore(studio): switch to type: module and convert configs to ESM/TS (#44839)
Switch studio's package.json to `"type": "module"` so the package runs
as native ESM. This aligns the runtime module system with what we
actually write (`import`/`export`), improves tree-shaking, and reduces
friction with ESM-only dependencies.

**Changed:**
- `next.config.js` → `next.config.ts` – ESM imports/exports, proper TS
types, fixed type narrowing on redirect `has` and `basePath` fields
- `csp.js` → `csp.ts` – `module.exports.getCSP` → named `export
function`
- `tailwind.config.js` → `tailwind.config.ts` – ESM imports
- `postcss.config.js` – `module.exports` → `export default` (stays `.js`
since PostCSS doesn't support TS configs)

**Removed:**
- Unused `path` import in next config
- Deprecated Sentry `hideSourceMaps` option (default behavior in Sentry
v10)

**Added:**
- Type declaration for `config/tailwind.config` CJS package

## To test

- A general smoke test of studio should suffice

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Refactor**
* Modernized the Studio package to ES module style and improved
TypeScript typings and config declarations to reduce build/runtime
issues.
* Updated styling and post-processing configuration format for more
consistent tooling behavior.

* **Chores**
* Updated code ownership entries to reflect migrated/renamed
configuration files.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Alaister Young <10985857+alaister@users.noreply.github.com>
2026-04-14 18:44:28 +09:00

127 lines
3.9 KiB
TypeScript

/* eslint-disable no-restricted-exports */
import containerQueries from '@tailwindcss/container-queries'
import tailwindConfig from 'config/tailwind.config'
export default tailwindConfig({
content: [
'./pages/**/*.{js,ts,jsx,tsx}',
'./components/**/*.{js,ts,jsx,tsx}',
// purge styles from grid library
'./../../packages/ui/src/**/*.{tsx,ts,js}',
'./../../packages/ui-patterns/src/**/*.{tsx,ts,js}',
],
plugins: [containerQueries],
theme: {
extend: {
fontSize: {
grid: '13px',
},
colors: {
/* typography */
'typography-body': {
light: 'hsl(var(--foreground-light))',
dark: 'hsl(var(--foreground-light))',
},
'typography-body-secondary': {
light: 'hsl(var(--foreground-lighter))',
dark: 'hsl(var(--foreground-lighter))',
},
'typography-body-strong': {
light: 'hsl(var(--foreground-default))',
dark: 'hsl(var(--foreground-default))',
},
'typography-body-faded': {
light: 'hsl(var(--foreground-muted))',
dark: 'hsl(var(--foreground-muted))',
},
/* Tables */
'table-body': {
light: 'hsl(var(--background-default))',
dark: 'hsl(var(--background-default))',
},
'table-header': {
light: 'hsl(var(--background-surface-100))',
dark: 'hsl(var(--background-surface-100))',
},
'table-footer': {
light: 'hsl(var(--background-surface-100))',
dark: 'hsl(var(--background-surface-100))',
},
'table-border': {
light: 'hsl(var(--border-default))',
dark: 'hsl(var(--border-default))',
},
/* Panels */
'panel-body': {
light: 'hsl(var(--background-surface-100))',
dark: 'hsl(var(--background-surface-100))',
},
'panel-header': {
light: 'hsl(var(--background-surface-100))',
dark: 'hsl(var(--background-surface-100))',
},
'panel-footer': {
light: 'hsl(var(--background-surface-100))',
dark: 'hsl(var(--background-surface-100))',
},
'panel-border': {
light: 'hsl(var(--border-default))',
dark: 'hsl(var(--border-default))',
},
'panel-border-interior': {
light: 'hsl(var(--border-muted))',
dark: 'hsl(var(--border-muted))',
},
'panel-border-hover': {
light: 'hsl(var(--border-muted))',
dark: 'hsl(var(--border-muted))',
},
},
animation: {
shimmer: 'shimmer 2s infinite linear',
'badge-shimmer': 'badge-shimmer 3s ease-in-out infinite',
'badge-pulse': 'badge-pulse 3s ease-in-out infinite',
'chevron-up': 'chevron-up 2s ease-in-out infinite',
sway: 'sway 3s cubic-bezier(0.4, 0, 0.6, 1) infinite',
},
keyframes: {
shimmer: {
'0%': {
'background-position': '-1000px 0',
},
'100%': {
'background-position': '1000px 0',
},
},
'badge-shimmer': {
'0%': { transform: 'rotate(-45deg) translateX(-100%)', opacity: '0' },
'10%': { opacity: '1' },
'40%': { opacity: '1' },
'50%': { transform: 'rotate(-45deg) translateX(100%)', opacity: '0' },
'100%': { transform: 'rotate(-45deg) translateX(100%)', opacity: '0' },
},
'badge-pulse': {
'0%, 100%': { opacity: '1' },
'50%': { opacity: '0.8' },
},
'chevron-up': {
'0%, 100%': { opacity: '0.2' },
'50%': { opacity: '1' },
},
sway: {
'0%, 100%': {
transform: 'rotate(-10deg) scale(1.5) translateY(4rem)',
},
'50%': {
transform: 'rotate(10deg) scale(1.5) translateY(2rem)',
},
},
},
},
},
})