From 0191116e6c52b49502ddd3d1e7ccc79ce378366d Mon Sep 17 00:00:00 2001 From: Elior Date: Wed, 18 Nov 2026 14:42:07 +0200 Subject: [PATCH 01/10] feat(docs): add MDX content component support --- astro.config.mjs | 22 ++++++++++++++++++++++ package.json | 2 ++ pnpm-lock.yaml | 16 ++++++++++++++++ src/content.config.ts | 34 +++++++++++++++++++++++++++++++++- 4 files changed, 73 insertions(+), 1 deletion(-) diff --git a/astro.config.mjs b/astro.config.mjs index 5f30a46..b588941 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,6 +1,8 @@ // @ts-check import { defineConfig } from 'astro/config'; +import mdx from '@astrojs/mdx'; import starlight from '@astrojs/starlight'; +import AutoImport from 'astro-auto-import'; // Material themes that have a matching bundled Shiki theme (code blocks follow these 5 only); // every other theme falls back to github-dark/light by its light/dark type. @@ -18,6 +20,25 @@ export default defineConfig({ trailingSlash: 'always', build: { format: 'directory' }, integrations: [ + // Content components are available in every MDX page without import lines. + // Order matters: AutoImport, then Starlight, then MDX (Expressive Code must precede MDX). + AutoImport({ + imports: [ + './src/components/content/AccentColors.astro', + './src/components/content/ChromeThemes.astro', + './src/components/content/ColorSwatch.astro', + './src/components/content/Figure.astro', + './src/components/content/Gallery.astro', + './src/components/content/PaletteColors.astro', + './src/components/content/RecommendedPlugins.astro', + './src/components/content/ThemeCard.astro', + './src/components/content/ThemeCards.astro', + './src/components/content/ThemeColors.astro', + './src/components/content/ThemePalette.astro', + './src/components/content/ThemePalettes.astro', + './src/components/content/Wallpapers.astro', + ], + }), starlight({ title: 'Material Theme UI', customCss: ['./src/styles/custom.css'], @@ -68,5 +89,6 @@ export default defineConfig({ }, }, }), + mdx(), ], }); diff --git a/package.json b/package.json index aed46a9..36c412e 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,10 @@ "format:check": "oxfmt --check && prettier --check \"src/**/*.astro\"" }, "dependencies": { + "@astrojs/mdx": "8.1.6", "@astrojs/starlight": "^0.43.1", "astro": "^7.3.6", + "astro-auto-import": "0.6.0", "js-yaml": "5.5.0", "sharp": "^0.35.3" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 465f7cc..8104300 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,12 +8,18 @@ importers: .: dependencies: + '@astrojs/mdx': + specifier: 8.1.6 + version: 8.1.6(@astrojs/markdown-satteri@0.4.10)(astro@7.4.12(@netlify/blobs@11.1.9)(@types/node@26.6.6)(esbuild@0.28.1)(yaml@2.9.1)) '@astrojs/starlight': specifier: ^0.43.1 version: 0.43.1(astro@7.4.12(@netlify/blobs@11.1.9)(@types/node@26.6.6)(esbuild@0.28.1)(yaml@2.9.1))(typescript@6.0.3) astro: specifier: ^7.3.6 version: 7.4.12(@netlify/blobs@11.1.9)(@types/node@26.6.6)(esbuild@0.28.1)(yaml@2.9.1) + astro-auto-import: + specifier: 0.6.0 + version: 0.6.0(astro@7.4.12(@netlify/blobs@11.1.9)(@types/node@26.6.6)(esbuild@0.28.1)(yaml@2.9.1)) js-yaml: specifier: 5.5.0 version: 5.5.0 @@ -2120,6 +2126,11 @@ packages: resolution: {integrity: sha512-6KuK/7nZ/2Qh7sGuVEiwxjCxzTY2Pdb5mTo5z1e6/J8BA0tvjR7G8vQJKrQMTqwmnA3UPEyKIFX4YUS1DO1Hvw==} engines: {node: '>=18'} + astro-auto-import@0.6.0: + resolution: {integrity: sha512-ru98hrmIZcLvNIcQWtGHKlYE2C+5+8dp86vGnDiGpdmqcFcG/Tn7uNVGhF1CUkvxNRtE+YZhmWTD94lnxY++rA==} + peerDependencies: + astro: ^7.2.4 + astro-expressive-code@0.44.4: resolution: {integrity: sha512-TxdQ/E1xP7P6gq9Z5XHuLNpWzgOP2xz7aKyW3w2FDkIOkXbcyXh/C7of7E+NYIX3Ws2Oq+Aaliuwy/ewavH+UQ==} peerDependencies: @@ -7770,6 +7781,11 @@ snapshots: ast-module-types@6.0.2: {} + astro-auto-import@0.6.0(astro@7.4.12(@netlify/blobs@11.1.9)(@types/node@26.6.6)(esbuild@0.28.1)(yaml@2.9.1)): + dependencies: + acorn: 8.19.0 + astro: 7.4.12(@netlify/blobs@11.1.9)(@types/node@26.6.6)(esbuild@0.28.1)(yaml@2.9.1) + astro-expressive-code@0.44.4(astro@7.4.12(@netlify/blobs@11.1.9)(@types/node@26.6.6)(esbuild@0.28.1)(yaml@2.9.1)): dependencies: astro: 7.4.12(@netlify/blobs@11.1.9)(@types/node@26.6.6)(esbuild@0.28.1)(yaml@2.9.1) diff --git a/src/content.config.ts b/src/content.config.ts index 6a7b7a0..e1be1ea 100644 --- a/src/content.config.ts +++ b/src/content.config.ts @@ -1,7 +1,39 @@ import { defineCollection } from 'astro:content'; +import { z } from 'astro/zod'; import { docsLoader } from '@astrojs/starlight/loaders'; import { docsSchema } from '@astrojs/starlight/schema'; +// Front matter that content components read (see src/components/content). The shapes match the +// Jekyll front matter so pages can be converted without reshaping their data. export const collections = { - docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), + docs: defineCollection({ + loader: docsLoader(), + schema: docsSchema({ + extend: z.object({ + gallery: z + .array( + z.object({ + images: z.array(z.object({ + filename: z.string(), + alttext: z.string() + })), + }), + ) + .optional(), + + wallpapers: z.array(z.object({ + filename: z.string(), + alttext: z.string() + })).optional(), + + chromeThemes: z + .array(z.object({ + name: z.string(), + imageUrl: z.string(), + url: z.string() + })) + .optional(), + }), + }), + }), }; From 73de74fcee3b4c4752ef35cac3b2181a95686910 Mon Sep 17 00:00:00 2001 From: Elior Date: Wed, 18 Nov 2026 14:42:25 +0200 Subject: [PATCH 02/10] test(docs): add content component e2e coverage --- e2e/content-components.spec.ts | 77 ++++++++++++++++++++++++++++++++++ src/styles/custom.css | 6 +++ 2 files changed, 83 insertions(+) create mode 100644 e2e/content-components.spec.ts diff --git a/e2e/content-components.spec.ts b/e2e/content-components.spec.ts new file mode 100644 index 0000000..f40ca46 --- /dev/null +++ b/e2e/content-components.spec.ts @@ -0,0 +1,77 @@ +import fs from 'node:fs'; +import { load } from 'js-yaml'; +import { expect, test } from '@playwright/test'; + +const readYaml = (file: string) => load(fs.readFileSync(`src/data/${file}`, 'utf8')) as T; + +test.describe('Accents page', () => { + test.beforeEach(async ({ page }) => { + await page.goto('/docs/configuration/accents/'); + }); + + test('renders one swatch per accent color in the data', async ({ page }) => { + const accents = readYaml<{ name: string }[]>('accentColors.yml'); + + await expect(page.locator('.mt-colors .mt-color')).toHaveCount(accents.length); + await expect(page.locator('.mt-colors .mt-color').first()).toContainText(accents[0].name); + }); + + test('figures are centered, link to the full-size image and have a caption', async ({ page }) => { + const figure = page.locator('figure.mt-figure', { hasText: 'Material Accent Picker' }); + const link = figure.locator('a'); + + await expect(link).toHaveAttribute('href', '/img/screens/accents/accentPicker.png'); + await expect(figure.locator('img')).toHaveAttribute( + 'src', + '/img/screens/accents/accentPicker.png', + ); + await expect(figure.locator('figcaption')).toHaveText('Material Accent Picker'); + + const box = (await figure.boundingBox())!; + const container = (await page.locator('.sl-markdown-content').boundingBox())!; + const left = box.x - container.x; + const right = container.x + container.width - (box.x + box.width); + + expect(Math.abs(left - right)).toBeLessThanOrEqual(2); + }); + + test('no figure link contains a double slash', async ({ page }) => { + const hrefs = await page + .locator('figure.mt-figure a') + .evaluateAll((links) => links.map((link) => link.getAttribute('href'))); + + expect(hrefs.length).toBeGreaterThan(0); + + for (const href of hrefs) { + expect(href).not.toContain('//'); + } + }); + + test('the gallery lists every front matter image and opens a lightbox', async ({ page }) => { + const gallery = page.locator('[data-mt-gallery] figure'); + + await expect(gallery).toHaveCount(21); + const link = gallery.first().locator('a'); + + // Lazy images have no height until loaded, so the link counts as hidden. + await link.locator('img').evaluate((img: HTMLImageElement) => { + img.loading = 'eager'; + }); + await link.click(); + await expect(page.locator('dialog[data-mt-lightbox]')).toBeVisible(); + await page.keyboard.press('Escape'); + await expect(page.locator('dialog[data-mt-lightbox]')).toBeHidden(); + }); +}); + +test.describe('Color Palette page', () => { + test('renders one palette card per theme, grouped as in the data', async ({ page }) => { + const groups = readYaml>('themes.yml'); + const total = Object.values(groups).flat().length; + + await page.goto('/docs/reference/color-palette/'); + + await expect(page.locator('.mt-theme-palette')).toHaveCount(total); + await expect(page.locator('#theme-oceanic')).toContainText('Background: #263238'); + }); +}); diff --git a/src/styles/custom.css b/src/styles/custom.css index d2190b4..029dfef 100644 --- a/src/styles/custom.css +++ b/src/styles/custom.css @@ -21,6 +21,12 @@ --mt-ribbon-fg: var(--mt-select-fg, #ffffff); } +/* Lead paragraph at the top of a page (the old `{:class='title'}`) */ +.sl-markdown-content p.title { + font-size: var(--sl-text-lg); + color: var(--sl-color-white); +} + /* Headings in the accent color */ .sl-markdown-content :is(h1, h2, h3, h4, h5, h6) { color: var(--sl-color-accent); From c774c9127615ac524aafa3c153823dd0271ca61f Mon Sep 17 00:00:00 2001 From: Elior Date: Wed, 18 Nov 2026 14:43:02 +0200 Subject: [PATCH 03/10] refactor(docs): move data files into src directory --- {_data => src/data}/accentColors.yml | 0 {_data => src/data}/authors.yml | 0 {_data => src/data}/colors.yml | 0 {_data => src/data}/nav.yml | 0 {_data => src/data}/recommendedPlugins.yml | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename {_data => src/data}/accentColors.yml (100%) rename {_data => src/data}/authors.yml (100%) rename {_data => src/data}/colors.yml (100%) rename {_data => src/data}/nav.yml (100%) rename {_data => src/data}/recommendedPlugins.yml (100%) diff --git a/_data/accentColors.yml b/src/data/accentColors.yml similarity index 100% rename from _data/accentColors.yml rename to src/data/accentColors.yml diff --git a/_data/authors.yml b/src/data/authors.yml similarity index 100% rename from _data/authors.yml rename to src/data/authors.yml diff --git a/_data/colors.yml b/src/data/colors.yml similarity index 100% rename from _data/colors.yml rename to src/data/colors.yml diff --git a/_data/nav.yml b/src/data/nav.yml similarity index 100% rename from _data/nav.yml rename to src/data/nav.yml diff --git a/_data/recommendedPlugins.yml b/src/data/recommendedPlugins.yml similarity index 100% rename from _data/recommendedPlugins.yml rename to src/data/recommendedPlugins.yml From 51c8ec961eac29d38085a9b1fa373993913168e0 Mon Sep 17 00:00:00 2001 From: Elior Date: Wed, 18 Nov 2026 14:43:39 +0200 Subject: [PATCH 04/10] refactor(docs): migrate docs pages to MDX components --- docs/reference/color-palette.md | 53 ------------------- .../docs/docs/configuration/accents.mdx | 40 ++++++-------- .../docs/docs/reference/color-palette.mdx | 19 +++++++ 3 files changed, 35 insertions(+), 77 deletions(-) delete mode 100644 docs/reference/color-palette.md rename docs/configuration/accents.md => src/content/docs/docs/configuration/accents.mdx (79%) create mode 100644 src/content/docs/docs/reference/color-palette.mdx diff --git a/docs/reference/color-palette.md b/docs/reference/color-palette.md deleted file mode 100644 index f80e28c..0000000 --- a/docs/reference/color-palette.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -layout: docs -title: Color Palette -group: reference -toc: true -comments: true - -previous: - url: '/docs/icons/associations-editor' - title: Icon Associations Editor -next: - url: '/docs/reference/file-icons' - title: File Icons ---- - -You can find here a reference of all colors used in the themes. -{:class='title'} - -{% include carbonads.html %} - -## Material themes - -
    -{% for theme in site.data.themes.material %} -{% include theme.html theme=theme %} -{% endfor %} -
- -
    -{% for theme in site.data.themes.material2 %} -{% include theme.html theme=theme %} -{% endfor %} -
- -## Other themes - -
    -{% for theme in site.data.themes.other %} -{% include theme.html theme=theme %} -{% endfor %} -
- -
    -{% for theme in site.data.themes.other2 %} -{% include theme.html theme=theme %} -{% endfor %} -
- -
    -{% for theme in site.data.themes.other3 %} -{% include theme.html theme=theme %} -{% endfor %} -
\ No newline at end of file diff --git a/docs/configuration/accents.md b/src/content/docs/docs/configuration/accents.mdx similarity index 79% rename from docs/configuration/accents.md rename to src/content/docs/docs/configuration/accents.mdx index 7530e6e..9b4296a 100644 --- a/docs/configuration/accents.md +++ b/src/content/docs/docs/configuration/accents.mdx @@ -1,17 +1,12 @@ --- -layout: docs title: Accents description: Colorize important parts of the UI -group: configuration -comments: true -toc: true - -previous: - url: '/docs/configuration/contrast' - title: Contrast Settings +prev: + link: /docs/configuration/contrast/ + label: Contrast Settings next: - url: '/docs/configuration/accent-mode' - title: Accent Mode + link: /docs/configuration/accent-mode/ + label: Accent Mode gallery: - images: @@ -59,10 +54,9 @@ gallery: alttext: Running Indicator in Run Configurations --- -The **Accent Colors** feature allows you to personalize and emphasize key UI elements throughout the IDE. -{:class='title'} - -{% include carbonads.html %} +

+ The Accent Colors feature allows you to personalize and emphasize key UI elements throughout the IDE. +

## Definition @@ -112,29 +106,27 @@ Accent colors can be configured in several ways: Since version 12.0.0, the **Accent Color Popup** has been completely redesigned with a modern UI. It now features dynamic SVG previews for each accent color, making it easier to visualize your choice before applying it. -{% include figure.html content="/screens/archive/accentChooser.png" caption="Material Toolbar Old Accent Chooser" %} +
-{% include figure.html content="/screens/accents/accentPicker.png" caption="Material Accent Picker" %} +
**Status Bar Accent Color Widget**: -{% include figure.html content="/screens/archive/accentColorWidget.png" caption="Status Bar Accent Chooser" %} +
**From The Settings**: -{% include figure.html content="/screens/settingsv3/accentColors.png" caption="Accent Color Settings" %} +
### Predefined accent colors Here is the list of predefined colors: -{% for color in site.data.accentColors %} -{% include color2.html color=color %} -{% endfor %} + ### Second Accent Color -Themes can define a secondary accent color. This color is utilized when [Accent Mode](/docs/configuration/accent-mode) is enabled, providing +Themes can define a secondary accent color. This color is utilized when [Accent Mode](/docs/configuration/accent-mode/) is enabled, providing a complementary highlight when the primary accent color is already prominent. ### Custom accent color @@ -148,11 +140,11 @@ To use a different color, uncheck the `Override Accent Color from Theme` option To see how your chosen accent color will appear, refer to the `Preview` section on the settings page. -{% include figure.html content="/screens/accents/accentPreview.png" caption="Accent Preview" %} +
## Gallery Note: These images are from earlier versions of the plugin and may not reflect current UI changes. For a real-time preview, navigate to the `UI DSL Showcase` settings screen within the IDE. -{% include gallery_lightbox.html %} \ No newline at end of file + \ No newline at end of file diff --git a/src/content/docs/docs/reference/color-palette.mdx b/src/content/docs/docs/reference/color-palette.mdx new file mode 100644 index 0000000..1dfbf23 --- /dev/null +++ b/src/content/docs/docs/reference/color-palette.mdx @@ -0,0 +1,19 @@ +--- +title: Color Palette +prev: + link: /docs/icons/associations-editor/ + label: Icon Associations Editor +next: + link: /docs/reference/file-icons/ + label: File Icons +--- + +

You can find here a reference of all colors used in the themes.

+ +## Material themes + + + +## Other themes + + From 55af1ba1f2ca7b75bd317b8d14d859958111170e Mon Sep 17 00:00:00 2001 From: Elior Date: Wed, 18 Nov 2026 14:44:14 +0200 Subject: [PATCH 05/10] refactor(data): add typed YAML data loaders --- src/data/load.ts | 10 ++++++++++ src/data/site.ts | 26 ++++++++++++++++++++++++++ src/data/themes.ts | 27 ++++++++++++++++++++++----- 3 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 src/data/load.ts create mode 100644 src/data/site.ts diff --git a/src/data/load.ts b/src/data/load.ts new file mode 100644 index 0000000..aca59af --- /dev/null +++ b/src/data/load.ts @@ -0,0 +1,10 @@ +import fs from 'node:fs'; +import path from 'node:path'; +import { load } from 'js-yaml'; + +// Reads a YAML file from src/data at build time. The YAML files stay the single source of truth. +export function readData(file: string): T { + const filePath = path.resolve(process.cwd(), 'src/data', file); + + return load(fs.readFileSync(filePath, 'utf8')) as T; +} diff --git a/src/data/site.ts b/src/data/site.ts new file mode 100644 index 0000000..7468c99 --- /dev/null +++ b/src/data/site.ts @@ -0,0 +1,26 @@ +// Typed access to the small YAML data sets (themes have their own module: ./themes.ts). +import { readData } from './load'; + +export interface AccentColor { + name: string; + color: string; + light?: boolean; +} + +// Palette colors are either a dark→light gradient (dark + light) or a single solid color. +export interface PaletteColor { + name: string; + dark: string; + light: string; + tags?: string[]; +} + +export interface RecommendedPlugin { + title: string; + url: string; + description: string; +} + +export const accentColors = readData('accentColors.yml'); +export const colors = readData('colors.yml'); +export const recommendedPlugins = readData('recommendedPlugins.yml'); diff --git a/src/data/themes.ts b/src/data/themes.ts index bdaa6a7..1bb7d51 100644 --- a/src/data/themes.ts +++ b/src/data/themes.ts @@ -1,11 +1,10 @@ // Single source of truth for the 32 Material themes: src/data/themes.yml (read at build time). -import fs from 'node:fs'; -import path from 'node:path'; -import { load } from 'js-yaml'; +import { readData } from './load'; export interface Theme { id: string; name: string; + desc: string; className: string; light: boolean; group: string; @@ -14,6 +13,7 @@ export interface Theme { text: string; selectBg: string; selectFg: string; + selectFg2: string; button: string; second: string; disabled: string; @@ -27,9 +27,27 @@ export interface Theme { white: string; green: string; red: string; + yellow: string; blue: string; purple: string; orange: string; + cyan: string; + gray: string; + error: string; + table: string; + tree: string; + excluded: string; + comments: string; + vars: string; + links: string; + functions: string; + keywords: string; + tags: string; + strings: string; + operators: string; + classes: string; + numbers: string; + parameters: string; } export const GROUP_LABELS: Record = { @@ -40,8 +58,7 @@ export const GROUP_LABELS: Record = { other3: 'Other (3)', }; -const file = path.resolve(process.cwd(), 'src/data/themes.yml'); -const raw = load(fs.readFileSync(file, 'utf8')) as Record[]>; +const raw = readData[]>>('themes.yml'); export const themeGroups: Record = Object.fromEntries( Object.entries(raw).map(([group, list]) => [group, list.map((t) => ({ ...t, group }))]), From d8d5fb5e9dba1fa0d236269f05cf0924ece33f30 Mon Sep 17 00:00:00 2001 From: Elior Date: Wed, 18 Nov 2026 14:46:36 +0200 Subject: [PATCH 06/10] style(config): enforce single attribute per line --- .oxfmtrc.json | 1 + .prettierrc.json | 1 + src/components/overrides/ThemeProvider.astro | 10 ++++-- src/components/theme/ThemeFab.astro | 10 ++++-- src/content.config.ts | 34 ++++++++++++-------- 5 files changed, 39 insertions(+), 17 deletions(-) diff --git a/.oxfmtrc.json b/.oxfmtrc.json index e137f35..ad399d6 100644 --- a/.oxfmtrc.json +++ b/.oxfmtrc.json @@ -1,6 +1,7 @@ { "$schema": "./node_modules/oxfmt/configuration_schema.json", "singleQuote": true, + "singleAttributePerLine": true, "ignorePatterns": [ "dist", ".astro", diff --git a/.prettierrc.json b/.prettierrc.json index 14a66ab..6cf8409 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,5 +1,6 @@ { "singleQuote": true, + "singleAttributePerLine": true, "plugins": ["prettier-plugin-astro"], "overrides": [{ "files": "*.astro", "options": { "parser": "astro" } }] } diff --git a/src/components/overrides/ThemeProvider.astro b/src/components/overrides/ThemeProvider.astro index ecb593b..b81850b 100644 --- a/src/components/overrides/ThemeProvider.astro +++ b/src/components/overrides/ThemeProvider.astro @@ -49,5 +49,11 @@ const script = `(() => { })();`; --- - - + + diff --git a/src/components/content/PaletteColors.astro b/src/components/content/PaletteColors.astro new file mode 100644 index 0000000..c7d3405 --- /dev/null +++ b/src/components/content/PaletteColors.astro @@ -0,0 +1,17 @@ +--- +// Replaces `{% for color in site.data.colors %}{% include color.html %}{% endfor %}` (Material palette). +import { colors } from '../../data/site'; +import ColorSwatch from './ColorSwatch.astro'; +--- + +
+ {colors.map((color) => ( + + ))} +
+ + diff --git a/src/components/content/RecommendedPlugins.astro b/src/components/content/RecommendedPlugins.astro new file mode 100644 index 0000000..f13742c --- /dev/null +++ b/src/components/content/RecommendedPlugins.astro @@ -0,0 +1,24 @@ +--- +// Replaces _includes/recommended-plugins.html, fed by src/data/recommendedPlugins.yml. +import { recommendedPlugins } from '../../data/site'; +--- + + + + + + + + + + + {recommendedPlugins.map((plugin) => ( + + + + + ))} + +
TitleDescription
+ {plugin.title} + {plugin.description}
diff --git a/src/components/content/ThemeCard.astro b/src/components/content/ThemeCard.astro new file mode 100644 index 0000000..6b69358 --- /dev/null +++ b/src/components/content/ThemeCard.astro @@ -0,0 +1,41 @@ +--- +// Replaces _includes/theme-card.html: a card with the theme name and description on its own background. +import type { Theme } from '../../data/themes'; + +interface Props { + theme: Theme; +} + +const { theme } = Astro.props; +const capitalize = (value: string) => + value.charAt(0).toUpperCase() + value.slice(1); +--- + +
  • + {capitalize(theme.name)} +

    {theme.desc}

    +
  • + + diff --git a/src/components/content/ThemeCards.astro b/src/components/content/ThemeCards.astro new file mode 100644 index 0000000..4141dea --- /dev/null +++ b/src/components/content/ThemeCards.astro @@ -0,0 +1,28 @@ +--- +// Replaces `
      {% for theme in site.data.themes. %}{% include theme-card.html %}`. +// Usage: +import { themeGroups } from '../../data/themes'; +import ThemeCard from './ThemeCard.astro'; + +interface Props { + groups: string[]; +} + +const list = Astro.props.groups.flatMap((group) => themeGroups[group] ?? []); +--- + +
        + {list.map((theme) => ( + + ))} +
      + + diff --git a/src/components/content/ThemeColors.astro b/src/components/content/ThemeColors.astro new file mode 100644 index 0000000..4059c0c --- /dev/null +++ b/src/components/content/ThemeColors.astro @@ -0,0 +1,31 @@ +--- +// Replaces `{% for theme in site.data.themes. %}{% include color.html color=theme field="..." %}`: +// one swatch per theme for a given theme property, e.g. . +import { themes } from '../../data/themes'; +import type { Theme } from '../../data/themes'; +import ColorSwatch from './ColorSwatch.astro'; + +interface Props { + field: keyof Theme; +} + +const { field } = Astro.props; +--- + +
      + {themes.map((theme) => ( + + ))} +
      + + diff --git a/src/components/content/ThemePalette.astro b/src/components/content/ThemePalette.astro new file mode 100644 index 0000000..7dd710d --- /dev/null +++ b/src/components/content/ThemePalette.astro @@ -0,0 +1,129 @@ +--- +// Replaces _includes/theme.html: the full color palette of one theme, each row styled with its own color. +import type { Theme } from '../../data/themes'; + +interface Props { + theme: Theme; +} + +type Row = [ + label: string, + key: keyof Theme, + css: (t: Theme, value: string) => string, +]; + +const text = (_: Theme, value: string) => `color: ${value}`; +const fill = (_: Theme, value: string) => `background: ${value}`; +const none = () => ''; + +const sections: Row[][] = [ + [ + ['Background', 'background', none], + ['Foreground', 'foreground', none], + ['Text', 'text', text], + [ + 'Selection Background', + 'selectBg', + (t, v) => `background: ${v}; color: ${t.selectFg}`, + ], + [ + 'Selection Foreground', + 'selectFg', + (t, v) => `background: ${t.selectBg}; color: ${v}`, + ], + ['Buttons', 'button', (t, v) => `background: ${v}; color: ${t.text}`], + ['Second Background', 'second', fill], + ['Disabled', 'disabled', text], + ['Contrast', 'contrast', fill], + ['Active', 'table', fill], + ['Border', 'border', (_, v) => `border: 2px solid ${v}`], + ['Highlight', 'hl', fill], + ['Tree', 'tree', (t, v) => `background: ${v}; color: ${t.selectFg}`], + ['Notifications', 'notif', fill], + ['Accent Color', 'accent', text], + ['Excluded Files Color', 'excluded', fill], + ], + [ + ['Green Color', 'green', text], + ['Yellow Color', 'yellow', text], + ['Blue Color', 'blue', text], + ['Red Color', 'red', text], + ['Purple Color', 'purple', text], + ['Orange Color', 'orange', text], + ['Cyan Color', 'cyan', text], + ['Gray Color', 'gray', text], + ['White/Black Color', 'white', text], + ['Error Color', 'error', text], + ], + [ + ['Comments Color', 'comments', text], + ['Variables Color', 'vars', text], + ['Links Color', 'links', text], + ['Functions Color', 'functions', text], + ['Keywords Color', 'keywords', text], + ['Tags Color', 'tags', text], + ['Strings Color', 'strings', text], + ['Operators Color', 'operators', text], + ['Attributes Color', 'attributes', text], + ['Numbers Color', 'numbers', text], + ['Parameters Color', 'parameters', text], + ], +]; + +const { theme } = Astro.props; +const capitalize = (value: string) => + value.charAt(0).toUpperCase() + value.slice(1); +--- + +
    • + {capitalize(theme.name)} + + {sections.map((rows, index) => ( + <> + {index > 0 &&
      } + {rows.map(([label, key, css]) => { + const value = String(theme[key]); + + return ( +

      + {label}: {value} +

      + ); + })} + + ))} +
    • + + diff --git a/src/components/content/ThemePalettes.astro b/src/components/content/ThemePalettes.astro new file mode 100644 index 0000000..363b6ab --- /dev/null +++ b/src/components/content/ThemePalettes.astro @@ -0,0 +1,28 @@ +--- +// Replaces `
        {% for theme in site.data.themes. %}{% include theme.html %}`. +// Usage: +import { themeGroups } from '../../data/themes'; +import ThemePalette from './ThemePalette.astro'; + +interface Props { + groups: string[]; +} + +const list = Astro.props.groups.flatMap((group) => themeGroups[group] ?? []); +--- + +
          + {list.map((theme) => ( + + ))} +
        + + diff --git a/src/components/content/Wallpapers.astro b/src/components/content/Wallpapers.astro new file mode 100644 index 0000000..e9db2de --- /dev/null +++ b/src/components/content/Wallpapers.astro @@ -0,0 +1,31 @@ +--- +// Replaces the `{% for wallpaper in page.wallpapers %}` loop. Reads the page's `wallpapers` front matter. +// Wallpaper filenames are full URLs (hosted on the image CDN), unlike gallery images. +const { wallpapers = [] } = Astro.locals.starlightRoute.entry.data; +--- + +
        + {wallpapers.map((wallpaper) => ( + {wallpaper.alttext} + ))} +
        + + From fd0c7732205c31bce247236e83dbc31d60736a0e Mon Sep 17 00:00:00 2001 From: Elior Date: Wed, 18 Nov 2026 17:01:16 +0200 Subject: [PATCH 08/10] refactor(docs): remove legacy feature files --- _features/01-lookandfeel.md | 6 ------ _features/02-colorschemes.md | 6 ------ _features/03-icons.md | 6 ------ _features/04-components.md | 6 ------ _features/05-customizable.md | 6 ------ _features/06-extensible.md | 6 ------ 6 files changed, 36 deletions(-) delete mode 100644 _features/01-lookandfeel.md delete mode 100644 _features/02-colorschemes.md delete mode 100644 _features/03-icons.md delete mode 100644 _features/04-components.md delete mode 100644 _features/05-customizable.md delete mode 100644 _features/06-extensible.md diff --git a/_features/01-lookandfeel.md b/_features/01-lookandfeel.md deleted file mode 100644 index 34c412a..0000000 --- a/_features/01-lookandfeel.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -author: mallowigi -featimg: lookandfeel.svg -title: A fresh new Look and Feel ---- -A brand look and feel with multiple flavors based on Material Design. diff --git a/_features/02-colorschemes.md b/_features/02-colorschemes.md deleted file mode 100644 index 1a681c0..0000000 --- a/_features/02-colorschemes.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -author: mallowigi -featimg: colorschemes.svg -title: Colorful color schemes ---- -A set of colorful color schemes with support for 60+ languages diff --git a/_features/03-icons.md b/_features/03-icons.md deleted file mode 100644 index e3fae7a..0000000 --- a/_features/03-icons.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -author: mallowigi -featimg: icons-folder.svg -title: Material Icons ---- -Replace icons with Material Design icons and Brand icons. diff --git a/_features/04-components.md b/_features/04-components.md deleted file mode 100644 index cb95d86..0000000 --- a/_features/04-components.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -author: mallowigi -featimg: background.svg -title: Material Components ---- -Redesign components' appearance: buttons, text fields, background, tabs... diff --git a/_features/05-customizable.md b/_features/05-customizable.md deleted file mode 100644 index ce832d2..0000000 --- a/_features/05-customizable.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -author: mallowigi -featimg: customizable.svg -title: Customizable ---- -Lots of options to customize the appearance to your taste. diff --git a/_features/06-extensible.md b/_features/06-extensible.md deleted file mode 100644 index 8586c34..0000000 --- a/_features/06-extensible.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -author: mallowigi -featimg: extensible.svg -title: Easily extensible ---- -Easily extensible for custom themes, schemes and icon associations. From b67f2623f037032333f97a45c6f1b1364c21947e Mon Sep 17 00:00:00 2001 From: Elior Date: Wed, 18 Nov 2026 17:01:34 +0200 Subject: [PATCH 09/10] feat(docs): add landing page content --- src/content/docs/index.mdx | 40 ++++++++++++++++++++++++++++++++++++-- src/data/features.yml | 23 ++++++++++++++++++++++ 2 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 src/data/features.yml diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx index 1df8064..6320b44 100644 --- a/src/content/docs/index.mdx +++ b/src/content/docs/index.mdx @@ -1,7 +1,43 @@ --- title: Material Theme UI -description: Scaffold placeholder, replaced by the landing page ticket. +description: A Material Design theme, color schemes and icons for JetBrains IDEs. template: splash +hero: + tagline: A Material Design theme, color schemes and icons for your JetBrains IDE. + image: + html: 'Material Theme UI logo' + actions: + - text: Download + link: https://plugins.jetbrains.com/plugin/8006-material-theme-ui + icon: external + variant: primary + - text: Get started + link: /docs/introduction/ + variant: minimal --- -Placeholder. +import ThemeChooser from '../../components/landing/ThemeChooser.astro'; +import Features from '../../components/landing/Features.astro'; +import Sponsors from '../../components/landing/Sponsors.astro'; + + + + + +## Other Editions + +The Material Theme is so famous that it exists for many other IDEs, editors, applications, css themes and so on. + +- [Hyper](https://github.com/equinusocio/hyper-material-theme) (by [@equinusocio](https://github.com/equinusocio)) +- [Atom](https://github.com/silvestreh/atom-material-ui) (by [@silvestreh](https://github.com/silvestreh)) +- [Vim](https://github.com/kristijanhusak/vim-hybrid-material) (by [@kristijanhusak](https://github.com/kristijanhusak)) +- [Terminal OSX](https://gist.github.com/mvaneijgen/4c56701215847dd5ddcf) (by [@mvaneijgen](https://github.com/mvaneijgen)) +- [iTerm2](https://gist.github.com/Revod/3f3115f8d4b90fc986fd4b61441c2567) (by [@Revod](https://github.com/Revod)) and [iTerm2 Palenight](https://github.com/JonathanSpeek/palenight-iterm2) (by [@jonathanspeek](https://github.com/jonathanspeek)) +- [ConEmu](https://gist.github.com/rajadain/b306b2ba71bd58a1df41) (by [@rajadain](https://github.com/rajadain)) +- [Nylas N1](https://github.com/jackiehluo/n1-material) (thanks to [@jackiehluo](https://github.com/jackiehluo)) +- [Base16](https://github.com/ntpeters/base16-materialtheme-scheme) (by [@ntpeters](https://github.com/ntpeters)) +- [Notepad++](https://github.com/Codextor/npp-material-theme) (by [@Codextor](https://github.com/Codextor)) +- [Chrome DevTools](https://chrome.google.com/webstore/detail/material-devtools-theme-c/jmefikbdhgocdjeejjnnepgnfkkbpgjo) (by [@Mallowigi](https://github.com/mallowigi) and [@jaysuz](https://github.com/jaysuz)) +- [Slack Themes](https://www.npmjs.com/package/@mallowigi/slack-themes) (by [@Mallowigi](https://github.com/mallowigi)) + + diff --git a/src/data/features.yml b/src/data/features.yml new file mode 100644 index 0000000..bd898d4 --- /dev/null +++ b/src/data/features.yml @@ -0,0 +1,23 @@ +- title: A fresh new Look and Feel + image: lookandfeel.svg + text: A brand look and feel with multiple flavors based on Material Design. + +- title: Colorful color schemes + image: colorschemes.svg + text: A set of colorful color schemes with support for 60+ languages + +- title: Material Icons + image: icons-folder.svg + text: Replace icons with Material Design icons and Brand icons. + +- title: Material Components + image: background.svg + text: "Redesign components' appearance: buttons, text fields, background, tabs..." + +- title: Customizable + image: customizable.svg + text: Lots of options to customize the appearance to your taste. + +- title: Easily extensible + image: extensible.svg + text: Easily extensible for custom themes, schemes and icon associations. From f285388b695c08a57e9c39866f99916b963311e1 Mon Sep 17 00:00:00 2001 From: Elior Date: Wed, 18 Nov 2026 17:01:47 +0200 Subject: [PATCH 10/10] feat(docs): add landing page components --- e2e/landing.spec.ts | 42 ++++++ e2e/themes.spec.ts | 6 +- src/components/landing/Features.astro | 73 +++++++++++ src/components/landing/Sponsors.astro | 41 ++++++ src/components/landing/ThemeChooser.astro | 149 ++++++++++++++++++++++ 5 files changed, 308 insertions(+), 3 deletions(-) create mode 100644 e2e/landing.spec.ts create mode 100644 src/components/landing/Features.astro create mode 100644 src/components/landing/Sponsors.astro create mode 100644 src/components/landing/ThemeChooser.astro diff --git a/e2e/landing.spec.ts b/e2e/landing.spec.ts new file mode 100644 index 0000000..89cfc17 --- /dev/null +++ b/e2e/landing.spec.ts @@ -0,0 +1,42 @@ +import { expect, test } from '@playwright/test'; + +test.describe('Landing page', () => { + test('renders the hero, features, other editions and sponsors', async ({ page }) => { + await page.goto('/'); + + await expect(page.getByRole('link', { name: 'Download' })).toHaveAttribute( + 'href', + 'https://plugins.jetbrains.com/plugin/8006-material-theme-ui', + ); + await expect(page.getByRole('heading', { name: 'Available Themes' })).toBeVisible(); + await expect(page.locator('.mt-chooser [data-mt-theme]')).toHaveCount(32); + await expect(page.locator('.mt-features li')).toHaveCount(6); + await expect(page.getByRole('heading', { name: 'Other Editions' })).toBeVisible(); + await expect(page.locator('.mt-sponsors a')).toHaveCount(10); + }); + + test('clicking a theme switches the site theme and the screenshot', async ({ page }) => { + await page.goto('/'); + + await page.locator('.mt-chooser [data-mt-theme="dracula"]').click(); + + await expect(page.locator('html')).toHaveAttribute('data-material-theme', 'dracula'); + await expect(page.locator('[data-mt-screenshot] img')).toHaveAttribute( + 'src', + '/img/themes/dracula.png', + ); + await expect(page.locator('.mt-chooser [data-mt-theme="dracula"]')).toHaveAttribute( + 'aria-pressed', + 'true', + ); + }); + + test('the screenshot also follows a theme set elsewhere', async ({ page }) => { + await page.goto('/?theme=monokai'); + + await expect(page.locator('[data-mt-screenshot] img')).toHaveAttribute( + 'src', + '/img/themes/monokai.png', + ); + }); +}); diff --git a/e2e/themes.spec.ts b/e2e/themes.spec.ts index 552eee1..1f35669 100644 --- a/e2e/themes.spec.ts +++ b/e2e/themes.spec.ts @@ -27,7 +27,7 @@ test('the saved theme is on before the body is parsed (no flash)', async test('a picked theme persists across reload and navigation', async ({ page }) => { await page.goto('/'); await openPicker(page); - await page.locator('[data-mt-theme="dracula"]').click(); + await page.locator('.mt-theme-fab [data-mt-theme="dracula"]').click(); await expect(html(page)).toHaveAttribute('data-material-theme', 'dracula'); await page.reload(); @@ -47,13 +47,13 @@ test('?theme= overrides the saved theme without replacing it', async ({ page }) test('all 32 themes can be picked and set light or dark accordingly', async ({ page }) => { await page.goto('/'); await openPicker(page); - const cards = page.locator('[data-mt-theme]'); + const cards = page.locator('.mt-theme-fab [data-mt-theme]'); await expect(cards).toHaveCount(32); for (const name of await cards.evaluateAll((els) => els.map((e) => (e as HTMLElement).dataset.mtTheme!), )) { - await page.locator(`[data-mt-theme="${name}"]`).click(); + await page.locator(`.mt-theme-fab [data-mt-theme="${name}"]`).click(); await expect(html(page)).toHaveAttribute('data-material-theme', name); const { scheme, theme } = await html(page).evaluate((el) => ({ scheme: getComputedStyle(el).colorScheme, diff --git a/src/components/landing/Features.astro b/src/components/landing/Features.astro new file mode 100644 index 0000000..fc970b0 --- /dev/null +++ b/src/components/landing/Features.astro @@ -0,0 +1,73 @@ +--- +// Replaces the _features collection + feature.html: six tiles read from src/data/features.yml. +import { readData } from '../../data/load'; + +interface Feature { + title: string; + image: string; + text: string; +} + +const features = readData('features.yml'); +--- + +
        +

        Features

        + +
          + {features.map((feature) => ( +
        • + +

          {feature.title}

          +

          {feature.text}

          +
        • + ))} +
        +
        + + diff --git a/src/components/landing/Sponsors.astro b/src/components/landing/Sponsors.astro new file mode 100644 index 0000000..b971530 --- /dev/null +++ b/src/components/landing/Sponsors.astro @@ -0,0 +1,41 @@ +--- +// The 10 OpenCollective sponsor avatars (slots 0-9); an unfilled slot just renders a blank avatar. +const slots = Array.from({ length: 10 }, (_, index) => index); +const base = + 'https://opencollective.com/atom-material-themes-and-plugins/sponsor'; +--- + +
        +

        Sponsors

        + +
        + {slots.map((slot) => ( + + {`Sponsor + + ))} +
        +
        + + diff --git a/src/components/landing/ThemeChooser.astro b/src/components/landing/ThemeChooser.astro new file mode 100644 index 0000000..cfc10f8 --- /dev/null +++ b/src/components/landing/ThemeChooser.astro @@ -0,0 +1,149 @@ +--- +// The landing page theme chooser. Swatches switch the whole site theme through the same +// window.materialTheme.apply() the floating button uses; the screenshot follows the current theme, +// so it also updates when the theme is changed from the floating button. +import { GROUP_LABELS, themeGroups } from '../../data/themes'; + +const featured = ['material', 'material2']; +const others = ['other', 'other2', 'other3']; +const sections = [ + { title: 'Available Themes', groups: featured }, + { title: 'Check out the other themes', groups: others }, +]; +--- + +
        + {sections.map((section, index) => ( + <> +

        {section.title}

        + + {section.groups.map((group) => ( +
          + {themeGroups[group].map((theme) => ( +
        • +
        • + ))} +
        + ))} + + {index === 0 && ( + + Oceanic theme screenshot + + )} + + ))} +
        + + + +