Files
modeling-app/tailwind.config.js
Zookeeper Lee 8fb1563f2d Billing UI (Nightly & Dev only) and Jest component unit testing (#6640)
A bajillion commits hi

* all the shit i'll git reset origin/main && git add -p . later

* fmt

* wip

* fmt

* rebase; fmt; tsc; lint;

* fmt

* Add jest tests

* fmt

* ok

* add nightly checks

* More is_nightly checks

* be happy codespell

* Make vitest ignore my shit

* nightly OR debug; try vitest fixing again

* Add this back

* fix

* Update src/components/LowerRightControls.tsx

Co-authored-by: Frank Noirot <frank@zoo.dev>

* Update src/components/LowerRightControls.tsx

Co-authored-by: Frank Noirot <frank@zoo.dev>

* Update src/components/LowerRightControls.tsx

Co-authored-by: Frank Noirot <frank@zoo.dev>

* Update src/components/BillingDialog.tsx

Co-authored-by: Frank Noirot <frank@zoo.dev>

* Update tailwind.config.js

Co-authored-by: Frank Noirot <frank@zoo.dev>

* Update tailwind.config.js

Co-authored-by: Frank Noirot <frank@zoo.dev>

* Update src/components/BillingRemaining.tsx

Co-authored-by: Frank Noirot <frank@zoo.dev>

* Update src/components/BillingRemaining.tsx

Co-authored-by: Frank Noirot <frank@zoo.dev>

* Update src/components/CustomIcon.tsx

Co-authored-by: Frank Noirot <frank@zoo.dev>

* Update src/components/CustomIcon.tsx

Co-authored-by: Frank Noirot <frank@zoo.dev>

* Update src/components/CustomIcon.tsx

Co-authored-by: Frank Noirot <frank@zoo.dev>

* Update src/components/CustomIcon.tsx

Co-authored-by: Frank Noirot <frank@zoo.dev>

* Update src/components/BillingRemaining.tsx

Co-authored-by: Frank Noirot <frank@zoo.dev>

* Update src/components/BillingRemaining.tsx

Co-authored-by: Frank Noirot <frank@zoo.dev>

* fixes

* tid bits

* Fix tests

* color

* Update src/components/BillingRemaining.tsx

Co-authored-by: Frank Noirot <frank@zoo.dev>

* fix someone else's problem

---------

Co-authored-by: Frank Noirot <frank@zoo.dev>
2025-05-06 15:07:22 -04:00

89 lines
2.8 KiB
JavaScript

const plugin = require('tailwindcss/plugin')
const themeColorRamps = [
{ name: 'chalkboard', stops: 12 },
{ name: 'energy', stops: 12 },
{ name: 'liquid', stops: 12 },
{ name: 'fern', stops: 12 },
{ name: 'cool', stops: 12 },
{ name: 'river', stops: 12 },
{ name: 'berry', stops: 12 },
{ name: 'destroy', stops: 8 },
{ name: 'warn', stops: 8 },
{ name: 'succeed', stops: 8 },
]
const toOKLCHVar = (val) => `oklch(var(${val}) / <alpha-value>) `
const themeColors = Object.fromEntries(
themeColorRamps.map(({ name, stops }) => [
name,
Object.fromEntries(
new Array(stops)
.fill(0)
.map((_, i) => [(i + 1) * 10, toOKLCHVar(`--_${name}-${(i + 1) * 10}`)])
),
])
)
/** @type {import('tailwindcss').Config} */
module.exports = {
mode: 'jit',
content: ['./src/**/*.{js,jsx,ts,tsx}'],
theme: {
extend: {
colors: {
primary: `oklch(var(--_primary) / <alpha-value>)`,
'ml-green': '#29FFA4',
'ml-black': 'var(--chalkboard-100)',
'ml-white': '#FFFFFF',
'ml-grey': 'var(--chalkboard-80)',
...themeColors,
},
fontFamily: {
display: `'owners', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif`,
sans: `'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif`,
},
/**
* We want the z-index of major UI areas
* to be consolidated in this one spot,
* so we can make sure they coordinate.
*/
zIndex: {
// TODO change use of `z-<number>` to use these instead
// underlay: '-1',
// tooltip: '1',
// commandBar: '2',
// modal: '3',
sketchSegmentIndicators: '5',
sketchOverlayDropdown: '6',
// top: '99',
},
},
},
darkMode: 'class',
plugins: [
require('@headlessui/tailwindcss'),
// custom plugin to add variants for aria-pressed
// To use, just add a class of 'group-pressed:<some-tailwind-class>' or 'pressed:<some-tailwind-class>'
// to your element. Based on https://dev.to/philw_/tying-tailwind-styling-to-aria-attributes-502f
plugin(function ({ addVariant, e }) {
addVariant('group-pressed', ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.group[aria-pressed='true'] .${e(
`group-pressed${separator}${className}`
)}`
})
})
addVariant('pressed', ({ modifySelectors, separator }) => {
modifySelectors(({ className }) => {
return `.${e(`pressed${separator}${className}`)}[aria-pressed='true']`
})
})
}),
],
}