diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..4708a898 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ + +# Preserve the exact upstream license bytes, including prose whitespace. +docs/stylesheets/vendor/semantic-theme/fonts/OFL-*.txt whitespace=-blank-at-eol + +# Both vendored token sets are checked against their original bytes. +docs/stylesheets/vendor/** -text diff --git a/docs/stylesheets/brand.css b/docs/stylesheets/brand.css index 710a60c7..a125dab3 100644 --- a/docs/stylesheets/brand.css +++ b/docs/stylesheets/brand.css @@ -40,7 +40,7 @@ --oa-display-font: var(--font-display); --oa-body-font: var(--font-body); --oa-mono-font: var(--font-mono); - --oa-radius-card: var(--radius-md); + --docs-radius-card: var(--oa-radius-card); --md-text-font: var(--oa-body-font); --md-code-font: var(--oa-mono-font); @@ -234,9 +234,6 @@ a:focus-visible { text-decoration-color: currentColor !important; text-decoration-thickness: 0.12em; } -[data-md-color-scheme="slate"] .md-typeset h1 { - color: var(--inset-text); -} /* Keep the tab bar in the same chrome as the public-site nav. */ .md-tabs { @@ -265,33 +262,14 @@ a:focus-visible { transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease; } -[data-md-color-scheme="default"] .md-typeset .md-button { +[data-md-color-scheme] .md-typeset .md-button { color: var(--oa-ink); } -[data-md-color-scheme="default"] .md-typeset .md-button:hover { +[data-md-color-scheme] .md-typeset .md-button:hover { background: var(--oa-ink-wash); border-color: var(--oa-ink); color: var(--oa-ink); } -[data-md-color-scheme="default"] .md-typeset .md-button--primary { - background: var(--oa-ink); - border-color: var(--oa-ink); - color: var(--oa-ground); -} -[data-md-color-scheme="default"] .md-typeset .md-button--primary:hover { - background: var(--inset-raised); - border-color: var(--inset-raised); - color: var(--oa-ground); -} -[data-md-color-scheme="slate"] .md-typeset .md-button { - border-color: var(--inset-text); - color: var(--inset-text); -} -[data-md-color-scheme="slate"] .md-typeset .md-button--primary { - background: var(--inset-text); - color: var(--inset-bg); -} - /* Hero lede on the home page. */ .md-typeset .oa-lede { font-size: 1.28rem; @@ -305,13 +283,9 @@ a:focus-visible { .md-typeset .grid.cards > ul > li, .md-typeset .grid > .card { border: 1px solid var(--oa-hairline); - border-radius: var(--oa-radius-card); + border-radius: var(--docs-radius-card); background: var(--oa-panel); } -[data-md-color-scheme="slate"] .md-typeset .grid.cards > ul > li { - border-color: var(--inset-border); - background: var(--inset-raised); -} .md-typeset .grid.cards > ul > li:hover { border-color: var(--oa-accent); box-shadow: var(--elevation-1); @@ -384,9 +358,11 @@ a:focus-visible { /* Material's default slate footer mutes copyright links below AA contrast at the small footer size. Keep the dark footer quiet, but make every action readable against the actual footer background. */ -[data-md-color-scheme="slate"] .md-footer, +[data-md-color-scheme="slate"] .md-footer { + background: var(--oa-ground); +} [data-md-color-scheme="slate"] .md-footer-meta { - background: color-mix(in srgb, var(--inset-bg) 80%, black); + background: var(--md-footer-bg-color); } [data-md-color-scheme="slate"] .md-footer__link, [data-md-color-scheme="slate"] .md-footer__title, diff --git a/docs/stylesheets/home.css b/docs/stylesheets/home.css index e42d7746..497702ea 100644 --- a/docs/stylesheets/home.css +++ b/docs/stylesheets/home.css @@ -203,11 +203,6 @@ .md-typeset .oa-docs-home a.oa-docs-path strong { color: var(--oa-home-ink); } -[data-md-color-scheme="slate"] .oa-docs-home { - --oa-home-border: var(--inset-border); - --oa-home-border-strong: var(--inset-border); - --oa-home-ink: var(--inset-text); -} .md-typeset .oa-docs-home > p:has(.md-button) { margin: 1rem 0 2rem; diff --git a/docs/stylesheets/semantic-theme.css b/docs/stylesheets/semantic-theme.css new file mode 100644 index 00000000..ea4f9512 --- /dev/null +++ b/docs/stylesheets/semantic-theme.css @@ -0,0 +1,44 @@ +/* Chosen website palette on Material's existing light/dark controls. */ +/* Material sets the scheme on body. The root controls viewport scrollbars. */ +html:has(> body[data-md-color-scheme="default"]) { color-scheme: light; } +html:has(> body[data-md-color-scheme="slate"]) { color-scheme: dark; } + +:root, [data-md-color-scheme] { + --oa-ground: var(--oa-canvas); + --oa-panel: var(--oa-surface-raised); + --oa-sunken: var(--oa-surface-sunken); + --oa-hairline: var(--oa-border); + --oa-hairline-strong: var(--oa-border-strong); + --oa-ink: var(--oa-text); + --oa-ink-wash: var(--oa-surface); + --oa-ink-2: var(--oa-text-muted); + --oa-ink-3: var(--oa-text-muted); + --oa-accent: var(--oa-link); + --oa-accent-hover: var(--oa-link-hover); + --oa-accent-bright: var(--oa-link-hover); + --oa-link-visited: var(--oa-link-hover); + --oa-link-underline: var(--oa-link); + --oa-link-visited-underline: var(--oa-link-hover); + --oa-focus-ring: var(--oa-focus); + --oa-display-font: var(--oa-font-display); + --oa-body-font: var(--oa-font-body); + --oa-mono-font: var(--oa-font-mono); + --md-text-font: var(--oa-font-body); + --md-code-font: var(--oa-font-mono); + --md-primary-fg-color: var(--oa-surface); + --md-primary-fg-color--light: var(--oa-surface-raised); + --md-primary-fg-color--dark: var(--oa-surface-sunken); + --md-primary-bg-color: var(--oa-text); + --md-primary-bg-color--light: var(--oa-text-muted); + --md-accent-fg-color: var(--oa-link); + --md-typeset-a-color: var(--oa-link); + --md-default-bg-color: var(--oa-canvas); + --md-default-fg-color: var(--oa-text); + --md-default-fg-color--light: var(--oa-text-muted); + --md-default-fg-color--lighter: var(--oa-text-muted); + --md-footer-bg-color: var(--oa-surface); + --md-footer-bg-color--dark: var(--oa-surface-sunken); +} +.md-header, [data-md-color-scheme="default"] .md-header { background: var(--oa-header-bg); color: var(--oa-text); } +[data-md-color-scheme] .md-typeset .md-button--primary { background: var(--oa-action); border-color: var(--oa-action); color: var(--oa-on-action); border-radius: var(--oa-radius-action); } +[data-md-color-scheme] .md-typeset .md-button--primary:hover { background: var(--oa-action-hover); border-color: var(--oa-action-hover); color: var(--oa-on-action); } diff --git a/docs/stylesheets/vendor/semantic-theme/fonts.css b/docs/stylesheets/vendor/semantic-theme/fonts.css new file mode 100644 index 00000000..f3409340 --- /dev/null +++ b/docs/stylesheets/vendor/semantic-theme/fonts.css @@ -0,0 +1,2 @@ +@font-face { font-family: "Public Sans"; src: url("./fonts/PublicSans-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; } +@font-face { font-family: "Inter Tight"; src: url("./fonts/InterTight-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; } diff --git a/docs/stylesheets/vendor/semantic-theme/fonts/InterTight-Variable.woff2 b/docs/stylesheets/vendor/semantic-theme/fonts/InterTight-Variable.woff2 new file mode 100644 index 00000000..d8f79a69 Binary files /dev/null and b/docs/stylesheets/vendor/semantic-theme/fonts/InterTight-Variable.woff2 differ diff --git a/docs/stylesheets/vendor/semantic-theme/fonts/OFL-InterTight.txt b/docs/stylesheets/vendor/semantic-theme/fonts/OFL-InterTight.txt new file mode 100644 index 00000000..b3501947 --- /dev/null +++ b/docs/stylesheets/vendor/semantic-theme/fonts/OFL-InterTight.txt @@ -0,0 +1,93 @@ +Copyright 2022 The Inter Project Authors (https://github.com/rsms/inter-tight) InterTight-Italic[wght].ttf: Copyright 2022 The Inter Project Authors (https://github.com/rsms/inter-tight) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/stylesheets/vendor/semantic-theme/fonts/OFL-PublicSans.txt b/docs/stylesheets/vendor/semantic-theme/fonts/OFL-PublicSans.txt new file mode 100644 index 00000000..9eef1e99 --- /dev/null +++ b/docs/stylesheets/vendor/semantic-theme/fonts/OFL-PublicSans.txt @@ -0,0 +1,93 @@ +Copyright 2015 The Public Sans Project Authors (https://github.com/uswds/public-sans) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/docs/stylesheets/vendor/semantic-theme/fonts/PublicSans-Variable.woff2 b/docs/stylesheets/vendor/semantic-theme/fonts/PublicSans-Variable.woff2 new file mode 100644 index 00000000..15b5f3da Binary files /dev/null and b/docs/stylesheets/vendor/semantic-theme/fonts/PublicSans-Variable.woff2 differ diff --git a/docs/stylesheets/vendor/semantic-theme/fonts/SOURCES.md b/docs/stylesheets/vendor/semantic-theme/fonts/SOURCES.md new file mode 100644 index 00000000..4b511ac0 --- /dev/null +++ b/docs/stylesheets/vendor/semantic-theme/fonts/SOURCES.md @@ -0,0 +1,24 @@ +# Font sources + +The site uses two faces, both licensed under the SIL Open Font License 1.1. +Each licence sits beside its file (`OFL-PublicSans.txt`, `OFL-InterTight.txt`). +Public Sans sets every page; Inter Tight sets the home page's display +headings only (components/home/Home.module.css), loaded there and not preloaded +site-wide. The site serves it itself; +no page calls a font CDN. + +| File | Face | Upstream version | Taken from | Subset and axes | Size | SHA-256 | +|---|---|---|---|---|---|---| +| `PublicSans-Variable.woff2` | Public Sans, by the USWDS project | 2.001 | npm `@fontsource-variable/public-sans@5.2.7`, file `public-sans-latin-wght-normal.woff2` | Latin, weight 100 to 900 | 26,832 bytes | `5ed4d31c988e73b258894244f209069ebe77dc7e564861954b21198b6de90d68` | +| `InterTight-Variable.woff2` | Inter Tight, by The Inter Project Authors (Google Fonts family) | Google Fonts v9 | npm `@fontsource-variable/inter-tight@5.3.0`, file `inter-tight-latin-wght-normal.woff2` | Latin, weight 100 to 900 | 44,872 bytes | `77fefe8ca19b9f69b5284832c519e0493127c1f091f0a8936884be7721c4e618` | + +Notes: + +- This is the same file the simple home page (site-v2/simple-real, 2026-10-12) + uses. Source Serif 4 was removed on 2026-10-14 when every page moved to the + simple page's tokens. +- The Latin subset covers English text, the curly quotes and apostrophes the + copy uses, and the currency signs. Characters outside it fall back to the + system sans-serif. +- To update the face, take the same file from a newer Fontsource release, + replace it here, update this table, and keep the licence file. diff --git a/docs/stylesheets/vendor/semantic-theme/provenance.json b/docs/stylesheets/vendor/semantic-theme/provenance.json new file mode 100644 index 00000000..02d02ea5 --- /dev/null +++ b/docs/stylesheets/vendor/semantic-theme/provenance.json @@ -0,0 +1,39 @@ +{ + "version": 2, + "source": "OpenAdaptAI/openadapt-web", + "commit": "f50e9c149cb868921e4ce414969dc57d44dc975b", + "files": { + "semantic-theme.css": { + "source": "styles/semantic-theme.css", + "sha256": "6680f37c3cd653d0c2ba46200458b76897aa1b79e132ede823806221f9907493" + }, + "semantic-theme.json": { + "source": "styles/semantic-theme.json", + "sha256": "c35929a94c399fce46d93bedf5d60a0abe3a49863473bb329da445b155222dc5" + }, + "fonts/PublicSans-Variable.woff2": { + "source": "public/fonts/PublicSans-Variable.woff2", + "sha256": "5ed4d31c988e73b258894244f209069ebe77dc7e564861954b21198b6de90d68" + }, + "fonts/InterTight-Variable.woff2": { + "source": "public/fonts/InterTight-Variable.woff2", + "sha256": "77fefe8ca19b9f69b5284832c519e0493127c1f091f0a8936884be7721c4e618" + }, + "fonts/OFL-PublicSans.txt": { + "source": "public/fonts/OFL-PublicSans.txt", + "sha256": "157a9e77f7580246e97c769490e2e977ae94399f9d30f4556015c41fe8c28bac" + }, + "fonts/OFL-InterTight.txt": { + "source": "public/fonts/OFL-InterTight.txt", + "sha256": "1e1c8b3dc6dfcbd5498a33f17fcc68ff2d39c599f6e8195fbf14601261dbef6a" + }, + "fonts/SOURCES.md": { + "source": "public/fonts/SOURCES.md", + "sha256": "392e12c886fe29aaa10b4940115e392dc1e4f1122c12bea12caefe0aac40627a" + }, + "fonts.css": { + "source": "generated by scripts/export-semantic-theme.mjs", + "sha256": "4dc1779d978335d0c2196e9ee62d49dcff16c55affe277dd9f2142c05df58e15" + } + } +} diff --git a/docs/stylesheets/vendor/semantic-theme/semantic-theme.css b/docs/stylesheets/vendor/semantic-theme/semantic-theme.css new file mode 100644 index 00000000..09adc120 --- /dev/null +++ b/docs/stylesheets/vendor/semantic-theme/semantic-theme.css @@ -0,0 +1,123 @@ +/* Generated by scripts/build-semantic-theme.mjs. Edit semantic-theme.json. */ + +:root, +[data-theme], +[data-md-color-scheme] { + --oa-font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + --oa-font-display: "Inter Tight", var(--oa-font-body); + --oa-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; + --oa-action: var(--oa-text); + --oa-on-action: var(--oa-canvas); + --oa-action-hover: color-mix(in srgb, var(--oa-text) 84%, var(--oa-canvas)); + --oa-radius-control: 8px; + --oa-radius-card: 14px; + --oa-radius-action: 9999px; + --oa-duration-fast: 150ms; + --oa-duration: 200ms; + --oa-duration-slow: 250ms; + --oa-easing: cubic-bezier(0.2, 0.7, 0.2, 1); +} + +:root, +[data-theme="dark"], +[data-theme="phosphor"], +[data-md-color-scheme="slate"] { + color-scheme: dark; + --oa-text: #edf1f7; + --oa-text-muted: #9ba7b7; + --oa-canvas: #05080d; + --oa-surface: #0a0f17; + --oa-surface-sunken: #0d141f; + --oa-surface-raised: #0d141f; + --oa-border: #1a2432; + --oa-border-strong: #2a3748; + --oa-link: #79adff; + --oa-link-hover: #a2c6ff; + --oa-on-link: #04101f; + --oa-link-tint: #0c1a2e; + --oa-focus: #a2c6ff; + --oa-verified: #3ad69f; + --oa-verified-strong: #7ae9c0; + --oa-verified-tint: #092a1f; + --oa-stopped: #f5b640; + --oa-stopped-strong: #fcd27a; + --oa-stopped-tint: #2a1d06; + --oa-reconcile: #ff8f86; + --oa-glow: radial-gradient(60% 55% at 50% 0%, rgba(84, 140, 255, 0.22), rgba(84, 140, 255, 0) 70%); + --oa-grid-dot: rgba(160, 190, 230, 0.10); + --oa-glass: rgba(13, 20, 31, 0.72); + --oa-shadow-lift: 0 30px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.04) inset; + --oa-header-bg: rgba(5, 8, 13, 0.72); +} + +[data-theme="light"], +[data-theme="paper"], +[data-theme="system"], +[data-md-color-scheme="default"] { + color-scheme: light; + --oa-text: #0f1722; + --oa-text-muted: #4f5a67; + --oa-canvas: #ffffff; + --oa-surface: #f5f7fa; + --oa-surface-sunken: #edf2f5; + --oa-surface-raised: #ffffff; + --oa-border: #dde3e9; + --oa-border-strong: #c6d0dc; + --oa-link: #1f4fbf; + --oa-link-hover: #1a43a3; + --oa-on-link: #ffffff; + --oa-link-tint: #eef3fc; + --oa-focus: #1f4fbf; + --oa-verified: #0b7a5a; + --oa-verified-strong: #07553e; + --oa-verified-tint: #e8f3ee; + --oa-stopped: #9a5b0a; + --oa-stopped-strong: #7a4706; + --oa-stopped-tint: #fcf3e6; + --oa-reconcile: #b3261e; + --oa-glow: radial-gradient(60% 55% at 50% 0%, rgba(31, 79, 191, 0.10), rgba(31, 79, 191, 0) 70%); + --oa-grid-dot: rgba(15, 23, 34, 0.08); + --oa-glass: rgba(255, 255, 255, 0.78); + --oa-shadow-lift: 0 30px 70px -34px rgba(15, 23, 34, 0.28), 0 0 0 1px rgba(15, 23, 34, 0.04) inset; + --oa-header-bg: rgba(255, 255, 255, 0.8); +} + +@media (prefers-color-scheme: dark) { + [data-theme="system"], + [data-theme="paper"] { + color-scheme: dark; + --oa-text: #edf1f7; + --oa-text-muted: #9ba7b7; + --oa-canvas: #05080d; + --oa-surface: #0a0f17; + --oa-surface-sunken: #0d141f; + --oa-surface-raised: #0d141f; + --oa-border: #1a2432; + --oa-border-strong: #2a3748; + --oa-link: #79adff; + --oa-link-hover: #a2c6ff; + --oa-on-link: #04101f; + --oa-link-tint: #0c1a2e; + --oa-focus: #a2c6ff; + --oa-verified: #3ad69f; + --oa-verified-strong: #7ae9c0; + --oa-verified-tint: #092a1f; + --oa-stopped: #f5b640; + --oa-stopped-strong: #fcd27a; + --oa-stopped-tint: #2a1d06; + --oa-reconcile: #ff8f86; + --oa-glow: radial-gradient(60% 55% at 50% 0%, rgba(84, 140, 255, 0.22), rgba(84, 140, 255, 0) 70%); + --oa-grid-dot: rgba(160, 190, 230, 0.10); + --oa-glass: rgba(13, 20, 31, 0.72); + --oa-shadow-lift: 0 30px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.04) inset; + --oa-header-bg: rgba(5, 8, 13, 0.72); + } +} + +@media (prefers-reduced-motion: reduce) { + :root, [data-theme], [data-md-color-scheme] { + --oa-duration-fast: 0ms; + --oa-duration: 0ms; + --oa-duration-slow: 0ms; + } +} diff --git a/docs/stylesheets/vendor/semantic-theme/semantic-theme.json b/docs/stylesheets/vendor/semantic-theme/semantic-theme.json new file mode 100644 index 00000000..d90982a0 --- /dev/null +++ b/docs/stylesheets/vendor/semantic-theme/semantic-theme.json @@ -0,0 +1,82 @@ +{ + "version": 2, + "source": "The chosen website palette and actions shipped in Home A; colors are unchanged.", + "roles": { + "action": "A neutral action is distinct from a verified result.", + "verified": "Only a saved record confirmed by read-back.", + "stopped": "A run stopped.", + "reconcile": "A person must check a possibly changed record.", + "link": "Navigation, progress and keyboard focus, never verification." + }, + "themes": { + "dark": { + "--oa-text": "#edf1f7", + "--oa-text-muted": "#9ba7b7", + "--oa-canvas": "#05080d", + "--oa-surface": "#0a0f17", + "--oa-surface-sunken": "#0d141f", + "--oa-surface-raised": "#0d141f", + "--oa-border": "#1a2432", + "--oa-border-strong": "#2a3748", + "--oa-link": "#79adff", + "--oa-link-hover": "#a2c6ff", + "--oa-on-link": "#04101f", + "--oa-link-tint": "#0c1a2e", + "--oa-focus": "#a2c6ff", + "--oa-verified": "#3ad69f", + "--oa-verified-strong": "#7ae9c0", + "--oa-verified-tint": "#092a1f", + "--oa-stopped": "#f5b640", + "--oa-stopped-strong": "#fcd27a", + "--oa-stopped-tint": "#2a1d06", + "--oa-reconcile": "#ff8f86", + "--oa-glow": "radial-gradient(60% 55% at 50% 0%, rgba(84, 140, 255, 0.22), rgba(84, 140, 255, 0) 70%)", + "--oa-grid-dot": "rgba(160, 190, 230, 0.10)", + "--oa-glass": "rgba(13, 20, 31, 0.72)", + "--oa-shadow-lift": "0 30px 80px -30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.04) inset", + "--oa-header-bg": "rgba(5, 8, 13, 0.72)" + }, + "light": { + "--oa-text": "#0f1722", + "--oa-text-muted": "#4f5a67", + "--oa-canvas": "#ffffff", + "--oa-surface": "#f5f7fa", + "--oa-surface-sunken": "#edf2f5", + "--oa-surface-raised": "#ffffff", + "--oa-border": "#dde3e9", + "--oa-border-strong": "#c6d0dc", + "--oa-link": "#1f4fbf", + "--oa-link-hover": "#1a43a3", + "--oa-on-link": "#ffffff", + "--oa-link-tint": "#eef3fc", + "--oa-focus": "#1f4fbf", + "--oa-verified": "#0b7a5a", + "--oa-verified-strong": "#07553e", + "--oa-verified-tint": "#e8f3ee", + "--oa-stopped": "#9a5b0a", + "--oa-stopped-strong": "#7a4706", + "--oa-stopped-tint": "#fcf3e6", + "--oa-reconcile": "#b3261e", + "--oa-glow": "radial-gradient(60% 55% at 50% 0%, rgba(31, 79, 191, 0.10), rgba(31, 79, 191, 0) 70%)", + "--oa-grid-dot": "rgba(15, 23, 34, 0.08)", + "--oa-glass": "rgba(255, 255, 255, 0.78)", + "--oa-shadow-lift": "0 30px 70px -34px rgba(15, 23, 34, 0.28), 0 0 0 1px rgba(15, 23, 34, 0.04) inset", + "--oa-header-bg": "rgba(255, 255, 255, 0.8)" + } + }, + "common": { + "--oa-font-body": "\"Public Sans\", -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif", + "--oa-font-display": "\"Inter Tight\", var(--oa-font-body)", + "--oa-font-mono": "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace", + "--oa-action": "var(--oa-text)", + "--oa-on-action": "var(--oa-canvas)", + "--oa-action-hover": "color-mix(in srgb, var(--oa-text) 84%, var(--oa-canvas))", + "--oa-radius-control": "8px", + "--oa-radius-card": "14px", + "--oa-radius-action": "9999px", + "--oa-duration-fast": "150ms", + "--oa-duration": "200ms", + "--oa-duration-slow": "250ms", + "--oa-easing": "cubic-bezier(0.2, 0.7, 0.2, 1)" + } +} diff --git a/mkdocs.yml b/mkdocs.yml index 5beaed69..0d58f244 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -65,6 +65,9 @@ extra_css: # defines no colour of its own. See the VENDORED.txt beside the copies. - stylesheets/vendor/openadapt-web/tokens.css - stylesheets/brand.css + - stylesheets/vendor/semantic-theme/semantic-theme.css + - stylesheets/vendor/semantic-theme/fonts.css + - stylesheets/semantic-theme.css - stylesheets/home.css extra_javascript: diff --git a/tests/fixtures/semantic-theme-roles.html b/tests/fixtures/semantic-theme-roles.html new file mode 100644 index 00000000..c005454f --- /dev/null +++ b/tests/fixtures/semantic-theme-roles.html @@ -0,0 +1,51 @@ + + + + + + + +
+
+

Heading

+ Secondary + Primary +
+
Quickstart
+
+ + + + diff --git a/tests/test_semantic_theme.py b/tests/test_semantic_theme.py new file mode 100644 index 00000000..f127c163 --- /dev/null +++ b/tests/test_semantic_theme.py @@ -0,0 +1,85 @@ +"""The selected theme is a pinned, licensed snapshot shared with the product UI.""" +import hashlib +import json +import shutil +import subprocess +from pathlib import Path + +import pytest + +ROOT = Path(__file__).resolve().parents[1] +VENDOR = ROOT / 'docs/stylesheets/vendor/semantic-theme' + + +def test_semantic_theme_snapshot_and_licenses_are_complete(): + proof = json.loads((VENDOR / 'provenance.json').read_text()) + assert proof['version'] == 2 + assert proof['source'] == 'OpenAdaptAI/openadapt-web' + for member in ['semantic-theme.css', 'semantic-theme.json', 'fonts.css', + 'fonts/OFL-PublicSans.txt', 'fonts/OFL-InterTight.txt', + 'fonts/PublicSans-Variable.woff2', 'fonts/InterTight-Variable.woff2', + 'fonts/SOURCES.md']: + assert member in proof['files'] + for name, item in proof['files'].items(): + assert not Path(name).is_absolute() + assert '..' not in Path(name).parts + assert hashlib.sha256((VENDOR / name).read_bytes()).hexdigest() == item['sha256'] + + +def test_navigation_does_not_use_the_verified_outcome_color(): + contract = json.loads((VENDOR / 'semantic-theme.json').read_text()) + for colors in contract['themes'].values(): + assert colors['--oa-link'] != colors['--oa-verified'] + assert colors['--oa-stopped'] != colors['--oa-reconcile'] + css = (ROOT / 'docs/stylesheets/semantic-theme.css').read_text() + assert '--md-typeset-a-color: var(--oa-link)' in css + assert '--oa-accent: var(--oa-link)' in css + + +@pytest.mark.parametrize("autocrlf", ["false", "true"]) +def test_checkout_preserves_both_vendor_snapshots(tmp_path, autocrlf): + git = ["git", "-C", str(ROOT)] + paths = subprocess.check_output( + [*git, "ls-files", "docs/stylesheets/vendor"], text=True + ).splitlines() + assert paths + subprocess.run( + [*git, "-c", f"core.autocrlf={autocrlf}", "checkout-index", + f"--prefix={tmp_path.as_posix()}/", "--", *paths], + check=True, + ) + for path in paths: + original = subprocess.check_output([*git, "show", f":{path}"]) + assert (tmp_path / path).read_bytes() == original, path + + +def test_material_paints_semantic_roles_in_both_schemes(tmp_path): + """Render the effective cascade, including Material and the real CSS load order.""" + from mkdocs.config import load_config + + browser = shutil.which("google-chrome") or shutil.which("chromium") or shutil.which("chromium-browser") + if not browser: + mac_chrome = Path("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome") + if not mac_chrome.is_file(): + pytest.skip("Chromium is required for the computed-style regression") + browser = str(mac_chrome) + + config = load_config(config_file=str(ROOT / "mkdocs.yml")) + material_css = next(Path(path) / "assets/stylesheets" for path in config.theme.dirs + if (Path(path) / "assets/stylesheets").is_dir()) + styles = [next(material_css.glob("main.*.min.css")), next(material_css.glob("palette.*.min.css"))] + styles.extend(Path(config.docs_dir) / path for path in config.extra_css) + links = "\n".join(f'' for path in styles) + fixture = (ROOT / "tests/fixtures/semantic-theme-roles.html").read_text() + page = tmp_path / "roles.html" + page.write_text(fixture.replace("", links)) + + result = subprocess.run( + [browser, "--headless", "--disable-gpu", "--disable-background-networking", + "--use-mock-keychain", "--password-store=basic", f"--user-data-dir={tmp_path}/profile", + "--allow-file-access-from-files", "--dump-dom", page.as_uri()], + capture_output=True, check=True, text=True, timeout=45, + ) + start = '' + errors = result.stdout.split(start, 1)[1].split("", 1)[0] + assert json.loads(errors) == []