diff --git a/.oxfmtrc.json b/.oxfmtrc.json
index e137f358..ad399d6b 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 14a66abe..6cf84090 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/_features/01-lookandfeel.md b/_features/01-lookandfeel.md
deleted file mode 100644
index 34c412a2..00000000
--- 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 1a681c03..00000000
--- 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 e3fae7a5..00000000
--- 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 cb95d865..00000000
--- 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 ce832d2c..00000000
--- 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 8586c345..00000000
--- 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.
diff --git a/astro.config.mjs b/astro.config.mjs
index 5f30a46a..b588941a 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/docs/reference/color-palette.md b/docs/reference/color-palette.md
deleted file mode 100644
index f80e28cc..00000000
--- 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/e2e/content-components.spec.ts b/e2e/content-components.spec.ts
new file mode 100644
index 00000000..f40ca46a
--- /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/e2e/landing.spec.ts b/e2e/landing.spec.ts
new file mode 100644
index 00000000..89cfc174
--- /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 552eee1c..1f356693 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/package.json b/package.json
index aed46a94..36c412ee 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 465f7cc9..81043008 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/components/content/AccentColors.astro b/src/components/content/AccentColors.astro
new file mode 100644
index 00000000..434c391b
--- /dev/null
+++ b/src/components/content/AccentColors.astro
@@ -0,0 +1,20 @@
+---
+// Replaces `{% for color in site.data.accentColors %}{% include color2.html %}{% endfor %}`.
+import { accentColors } from '../../data/site';
+import ColorSwatch from './ColorSwatch.astro';
+---
+
+
+ {accentColors.map((color) => (
+
+ ))}
+
+
+
diff --git a/src/components/content/ChromeThemes.astro b/src/components/content/ChromeThemes.astro
new file mode 100644
index 00000000..4717cd3f
--- /dev/null
+++ b/src/components/content/ChromeThemes.astro
@@ -0,0 +1,52 @@
+---
+// Replaces _includes/chromethemes.html. Reads the page's `chromeThemes` front matter
+// (previously `gallery.themes`).
+const { chromeThemes = [] } = Astro.locals.starlightRoute.entry.data;
+---
+
+
+ {chromeThemes.map((theme) => (
+
+
+
+ {theme.name}
+
+
+ ))}
+
+
+
diff --git a/src/components/content/ColorSwatch.astro b/src/components/content/ColorSwatch.astro
new file mode 100644
index 00000000..134f24d5
--- /dev/null
+++ b/src/components/content/ColorSwatch.astro
@@ -0,0 +1,71 @@
+---
+// Replaces _includes/color.html and color2.html: a gradient (dark → light) or a solid color swatch.
+// Usage: , or .
+import type { AccentColor, PaletteColor } from '../../data/site';
+import type { Theme } from '../../data/themes';
+
+interface Props {
+ color?: PaletteColor | AccentColor;
+ theme?: Theme;
+ field?: keyof Theme;
+}
+
+const { color, theme, field } = Astro.props;
+
+const capitalize = (value: string) =>
+ value.charAt(0).toUpperCase() + value.slice(1);
+
+let name = '';
+let title = '';
+let style = '';
+let tags: string[] = [];
+const isGradient = !!color && 'dark' in color;
+
+if (color && 'dark' in color) {
+ name = capitalize(color.name);
+ title = `${color.dark} - ${color.light}`;
+ style = `background: linear-gradient(to right, ${color.dark} 0%, ${color.light} 100%)`;
+ tags = color.tags ?? [];
+} else if (color) {
+ name = capitalize(color.name);
+ title = color.color;
+ style = `background: ${color.color}; color: ${color.light ? 'black' : 'white'}`;
+} else if (theme && field) {
+ const value = String(theme[field]);
+
+ name = capitalize(theme.name);
+ title = value;
+ style = `background: ${value}; color: ${theme.light ? 'black' : 'white'}`;
+}
+---
+
+
+
{name}
+ {tags.length > 0 &&
Tags: {tags.join(', ')}
}
+
+
+
diff --git a/src/components/content/Figure.astro b/src/components/content/Figure.astro
new file mode 100644
index 00000000..4c3970c4
--- /dev/null
+++ b/src/components/content/Figure.astro
@@ -0,0 +1,61 @@
+---
+// Replaces _includes/figure.html. Authors pass the same `content` / `caption` the Liquid include took.
+interface Props {
+ content: string;
+ caption: string;
+}
+
+const { content, caption } = Astro.props;
+
+// The old include produced `/img//screens/...` because `content` started with a slash; collapse it.
+const src = `/img/${content}`.replace(/\/{2,}/g, '/');
+---
+
+
+
+
+
+
+ {caption}
+
+
+
diff --git a/src/components/content/Gallery.astro b/src/components/content/Gallery.astro
new file mode 100644
index 00000000..2e683e9d
--- /dev/null
+++ b/src/components/content/Gallery.astro
@@ -0,0 +1,206 @@
+---
+// Replaces _includes/gallery_lightbox.html: a masonry of figure cards that open in a small lightbox.
+// Reads the page's `gallery` front matter (same shape as the Jekyll one), so authors just write .
+const { gallery = [] } = Astro.locals.starlightRoute.entry.data;
+const images = gallery.flatMap((group) => group.images);
+---
+
+
+ {images.map((image, index) => (
+
+
+
+
+
+ {image.alttext}
+
+ ))}
+
+
+
+
+ ✕
+
+
+ ‹
+
+
+
+
+
+
+
+
+ ›
+
+
+
+
+
+
diff --git a/src/components/content/PaletteColors.astro b/src/components/content/PaletteColors.astro
new file mode 100644
index 00000000..c7d34052
--- /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 00000000..f13742c2
--- /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';
+---
+
+
+
+
+ Title
+ Description
+
+
+
+
+ {recommendedPlugins.map((plugin) => (
+
+
+ {plugin.title}
+
+ {plugin.description}
+
+ ))}
+
+
diff --git a/src/components/content/ThemeCard.astro b/src/components/content/ThemeCard.astro
new file mode 100644
index 00000000..6b69358b
--- /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 00000000..4141deae
--- /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 00000000..4059c0ce
--- /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 00000000..7dd710d8
--- /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 00000000..363b6aba
--- /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 00000000..e9db2de5
--- /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) => (
+
+ ))}
+
+
+
diff --git a/src/components/landing/Features.astro b/src/components/landing/Features.astro
new file mode 100644
index 00000000..fc970b0f
--- /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 00000000..b971530c
--- /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';
+---
+
+
+
+
diff --git a/src/components/landing/ThemeChooser.astro b/src/components/landing/ThemeChooser.astro
new file mode 100644
index 00000000..cfc10f8d
--- /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) => (
+
+
+ {theme.name}
+
+ ))}
+
+ ))}
+
+ {index === 0 && (
+
+
+
+ )}
+ >
+ ))}
+
+
+
+
+
diff --git a/src/components/overrides/ThemeProvider.astro b/src/components/overrides/ThemeProvider.astro
index ecb593b7..b81850b9 100644
--- a/src/components/overrides/ThemeProvider.astro
+++ b/src/components/overrides/ThemeProvider.astro
@@ -49,5 +49,11 @@ const script = `(() => {
})();`;
---
-
-
+
+
diff --git a/src/components/theme/ThemeFab.astro b/src/components/theme/ThemeFab.astro
index b26933a4..865b5a36 100644
--- a/src/components/theme/ThemeFab.astro
+++ b/src/components/theme/ThemeFab.astro
@@ -12,7 +12,10 @@ import { themeGroups, GROUP_LABELS } from '../../data/themes';
aria-labelledby="mt-theme-fab-title"
>
-
+
Theme
@@ -43,7 +46,10 @@ import { themeGroups, GROUP_LABELS } from '../../data/themes';
>
{t.name}
-
+
{[t.accent, t.foreground, t.selectBg, t.button, t.border].map(
(c) => (
diff --git a/src/content.config.ts b/src/content.config.ts
index 6a7b7a02..559b689f 100644
--- a/src/content.config.ts
+++ b/src/content.config.ts
@@ -1,7 +1,47 @@
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(),
+ }),
+ }),
+ }),
};
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 7530e6ea..9b4296a0 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 00000000..1dfbf230
--- /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
+
+
diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx
index 1df80649..6320b449 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: ' '
+ 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/_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/src/data/features.yml b/src/data/features.yml
new file mode 100644
index 00000000..bd898d42
--- /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.
diff --git a/src/data/load.ts b/src/data/load.ts
new file mode 100644
index 00000000..aca59afe
--- /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/_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
diff --git a/src/data/site.ts b/src/data/site.ts
new file mode 100644
index 00000000..7468c998
--- /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 bdaa6a72..1bb7d517 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 }))]),
diff --git a/src/styles/custom.css b/src/styles/custom.css
index d2190b47..029dfefa 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);