diff --git a/website/app/[locale]/(root)/docs/colors/content.mdx b/website/app/[locale]/(root)/docs/colors/content.mdx index fa9cb5281..cb01c09f0 100644 --- a/website/app/[locale]/(root)/docs/colors/content.mdx +++ b/website/app/[locale]/(root)/docs/colors/content.mdx @@ -3,7 +3,7 @@ --- -## Customization +## Basic usage ### Add a color Add your color variables using hex codes and extend the defaults. ```js name=master.css.js @@ -80,26 +80,7 @@ export default { --- -## Style guide -### Create background colors -Create color variables for backgrounds in apps, panels, cards, and more. -```js name=master.css.js -export default { - variables: { -+ neutral: '$(white)', -+ fade: '$(slate-5)' - } -} -``` -Use [background-color](/docs/background-color) syntax to set the app background color: -```html -
… -``` -| Token | Description | -|-------------------|-----------------------------------------------------------------------------------------------------------------------------------| -| `neutral` | The background color for apps... | -| `fade` | The background color for panels... | - +## Foreground ### Create text colors Create accessible color variables for titles, descriptions, icons, and other body text. ```js name=master.css.js @@ -134,3 +115,25 @@ You can apply them using any color-related syntax. | `text-strong` | Strong color, used for main titles, subheadings, or slightly emphasized fields, creating a high contrast with the background. | | `text-dim` | Dim color, a foreground color that contrasts slightly with the background. | | `text-{color}` | Other accessible text foreground colors. | + +--- + +## Background +### Create background colors +Create color variables for backgrounds in apps, panels, cards, and more. +```js name=master.css.js +export default { + variables: { ++ neutral: '$(white)', ++ fade: '$(slate-5)' + } +} +``` +Use [background-color](/docs/background-color) syntax to set the app background color: +```html +… +``` +| Token | Description | +|-------------------|-----------------------------------------------------------------------------------------------------------------------------------| +| `neutral` | The background color for apps... | +| `fade` | The background color for panels... | diff --git a/website/app/[locale]/(root)/play/Play.tsx b/website/app/[locale]/(root)/play/Play.tsx index 3d6c97d87..5111e60d5 100644 --- a/website/app/[locale]/(root)/play/Play.tsx +++ b/website/app/[locale]/(root)/play/Play.tsx @@ -12,7 +12,6 @@ import dedent from 'ts-dedent' // import DocHeader from 'websites/layouts/Doc/DocHeader' import { IconBrandCss3, IconChevronDown, IconDeviceDesktop, IconDeviceMobile } from '@tabler/icons-react' import Tabs, { Tab } from 'websites/components/Tabs' -import { l } from 'to-line' // import { Button } from 'websites/components/App/AppBtn' import { usePathname, useRouter } from 'next/navigation' import LanguageButton from 'websites/components/LanguageButton'; @@ -40,11 +39,12 @@ import dynamic from 'next/dynamic' import i18n from 'websites/i18n.config.mjs' import { mediaQueries } from '@master/css' import config from '~/master.css' +import clsx from 'clsx' // import { Registry } from 'monaco-textmate' // import { wireTmGrammars } from 'monaco-editor-textmate' -// loader.config({ +// loader.config({ // paths: { // vs: '/monaco-editor/vs', // } @@ -92,7 +92,7 @@ export default function Play(props: any) { const [shareId, setShareId] = useState(props.shareId ?? '') const [sharing, setSharing] = useState(false) const [version, setVersion] = useState(props.shareItem?.version ?? latestMasterCSSVersion) - const [generatedCssText, setGeneratedCssText] = useState('') + const [generatedCSSText, setGeneratedCSSText] = useState('') const template = useMemo(() => templates.find((eachTemplate) => eachTemplate.version === version), [version]) const [previewErrorEvent, setPreviewErrorEvent] = useState