Skip to content

Commit 42ca997

Browse files
committed
Docs: Initial work on a styling override interface
1 parent c7fe782 commit 42ca997

File tree

1 file changed

+50
-19
lines changed

1 file changed

+50
-19
lines changed

.github/docs/agnostic-theme-interfaces-proposal.md

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ laid out in docs-platform/629.
55

66
Nothing in this document should be considered final and is subject to change.
77

8-
### Site Config
8+
## Site Config
99

1010
```yaml
1111
params:
@@ -15,10 +15,10 @@ params:
1515
items: <Product[]>
1616
# Product Group Label
1717
- title: <string>
18-
# The URL prefix used for the section (Ex. 'nginx' for NGINX+)
19-
url: <string>
18+
# The common top-level path for all documents within a domain; i.e. 'nginx' for NGINX+
19+
pathPrefix: <string>
2020
# Whether this link is external to the site
21-
extUrl: <bool | undefined>
21+
extUrl: <bool>
2222
header:
2323
# Header Nav items
2424
navItems: <NavItem[]>
@@ -39,26 +39,22 @@ params:
3939
logo: <string | undefined>
4040
# Path for icon logo (Used in small width contexts), fallback to "logo" if not defined
4141
iconLogo: <string | undefined>
42-
primary: <string | undefined>
43-
secondary: <string | undefined>
44-
# Replicates the interface for .Site.params.brand, minus iconSet and favicon
42+
# Used for dark mode variant assets
4543
dark:
4644
logo: <string>
4745
iconLogo: <string>
48-
primary: <string>
49-
secondary: <string>
5046
footer:
5147
# Default to &copy;{currentYear} F5, Inc. All rights reserved
5248
copyrightText: <string | undefined>
5349
items: <NavItem[]>
5450
- title: <string>
5551
# Item URL
5652
href: <string>
57-
extUrl: <boolean>
53+
extUrl: <bool>
5854

5955
```
6056

61-
### F5 Sites
57+
## F5 Sites
6258

6359
Collection of F5Site types. Used to define items for the "F5 Sites" dropdown.
6460

@@ -74,26 +70,63 @@ params:
7470

7571
```
7672

77-
### Product Selector
73+
## Product Selector
7874

79-
Defined in Hugo config as this applies sitewide. Optionally, keep `data/` files as source
80-
instead of defined in `hugo.yaml` but less explicit.
75+
The product selector is one of the theme's two main mechanism's for content navigation (both internal and external).
76+
In the context of the NGINX Docs, it's used to group products according to their broader product domains.
8177

8278
```yaml
8379
params:
8480
productSelector: <ProductGroup[]>
81+
# Product group label (i.e NGINX One)
8582
- groupLabel: <string>
83+
# Individual product landing pages within that domain
8684
items: <Product[]>
8785
# Product Label
8886
- title: <string>
8987
# The URL prefix used for the section (Ex. 'nginx' for NGINX+).
9088
url: <string | undefined>
9189
# Whether the URL is external to the site (opens a new tab if true)
92-
extUrl: <bool | undefined>
90+
extUrl: <bool>
9391

9492
```
9593

96-
### Icon Partial
94+
## Styling Overrides
95+
96+
> Implementation detail: We ideally don't want to force theme users into raw oklch values; it would be a much nicer
97+
surface if theme consumers could use a color keyword of their choice (rgb, hwb, hsl). However, that surface change
98+
would require we rewrite all our current CSS variable calls
99+
100+
**Consumer: `assets/style.css`**
101+
```css
102+
:root {
103+
--color-brand: 56.6% 0.194 147.7;
104+
--color-brand-300: 0.84 0.0699 157.51;
105+
--color-brand-200: 0.91 0.0406 157.72;
106+
--color-brand-100: 0.98 0.0107 158.85;
107+
108+
--color-background: 1 0 0;
109+
--color-foreground: 0 0 0;
110+
--color-shadow: 0.86 0 0;
111+
112+
/* Dark Mode Variables */
113+
--dark_color-brand: 56.6% 0.194 147.7;
114+
--dark_color-brand-300: 0.84 0.0699 157.51;
115+
--dark_color-brand-200: 0.91 0.0406 157.72;
116+
--dark_color-brand-100: 0.98 0.0107 158.85;
117+
118+
--dark_color-background: 1 0 0;
119+
--dark_color-foreground: 0 0 0;
120+
--dark_color-shadow: 0.86 0 0;
121+
}
122+
```
123+
124+
* Variables defined in any consumer CSS files should override reasonable defaults.
125+
* Pre-defined theming support could be offered by creating CSS files defining these variables that are then
126+
loaded based on an ID (or similar mechanism).
127+
* Ex. F5 Theme or NGINX Theme
128+
129+
## Icon Partial
97130

98131
| Param | Type | Note |
99132
|---------------|------------------------|--------------------------------------------------------------------------------------------------------------|
@@ -106,10 +139,8 @@ params:
106139
{{ partial "icon.html" set="lucide" size="md" icon="test-icon-id" _iconDirect="" . }}
107140
```
108141

109-
### Additional Notes
142+
## Additional Notes
110143

111-
* Style variables defined in Hugo config may be detrimental to IDE integrations that read values for color display
112-
* Optionally, require theme consumers to set variables directly in a CSS file rather than config.
113144
* Some of these new schemas are breaking but given the low-level of current consumers, this is the best time to make schema adjustments before wider rollout.
114145

115146
### Optional Collection Definition Pattern

0 commit comments

Comments
 (0)