Skip to content

Commit 9c1d278

Browse files
authored
docs: deprecation pages and styles fixed (#2611)
1 parent 4498790 commit 9c1d278

34 files changed

+1647
-2682
lines changed

.github/workflows/publish-site.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
- name: Build storybook site
8888
if: ${{ inputs.storybook-url == '' }}
8989
shell: bash
90-
run: yarn ci:storybook --output-dir ../dist/preview
90+
run: yarn nx run storybook:build:docs
9191

9292
## --- DEPLOY WEBSITE TO NETLIFY --- ##
9393
- name: Deploy

.storybook/deprecated/splitbutton/splitbutton.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ examples:
88
markup: |
99
<div class="spectrum-SplitButton">
1010
<button class="spectrum-Button spectrum-Button--sizeM spectrum-Button--fill spectrum-Button--accent spectrum-SplitButton-action"><span class="spectrum-Button-label">Split Button</span></button>
11-
<button class="spectrum-Button spectrum-Button--sizeM spectrum-Button--fill spectrum-Button--accent spectrum-SplitButton-trigger">
11+
<button class="spectrum-Button spectrum-Button--sizeM spectrum-Button--fill spectrum-Button--accent spectrum-Button--iconOnly spectrum-SplitButton-trigger">
1212
<svg class="spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-SplitButton-icon" focusable="false" aria-hidden="true">
1313
<use xlink:href="#spectrum-css-icon-Chevron100" />
1414
</svg>
@@ -19,7 +19,7 @@ examples:
1919
<br>
2020
2121
<div class="spectrum-SplitButton spectrum-SplitButton--left">
22-
<button class="spectrum-Button spectrum-Button--sizeM spectrum-Button--fill spectrum-Button--accent spectrum-SplitButton-trigger">
22+
<button class="spectrum-Button spectrum-Button--sizeM spectrum-Button--fill spectrum-Button--iconOnly spectrum-Button--accent spectrum-SplitButton-trigger">
2323
<svg class="spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-SplitButton-icon" focusable="false" aria-hidden="true">
2424
<use xlink:href="#spectrum-css-icon-Chevron100" />
2525
</svg>
@@ -32,7 +32,7 @@ examples:
3232
markup: |
3333
<div class="spectrum-SplitButton">
3434
<button class="spectrum-Button spectrum-Button--sizeM spectrum-Button--outline spectrum-Button--primary spectrum-SplitButton-action"><span class="spectrum-Button-label">Split Button</span></button>
35-
<button class="spectrum-Button spectrum-Button--sizeM spectrum-Button--outline spectrum-Button--primary spectrum-SplitButton-trigger">
35+
<button class="spectrum-Button spectrum-Button--sizeM spectrum-Button--outline spectrum-Button--primary spectrum-Button--iconOnly spectrum-SplitButton-trigger">
3636
<svg class="spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-SplitButton-icon" focusable="false" aria-hidden="true">
3737
<use xlink:href="#spectrum-css-icon-Chevron100" />
3838
</svg>
@@ -43,7 +43,7 @@ examples:
4343
<br>
4444
4545
<div class="spectrum-SplitButton spectrum-SplitButton--left">
46-
<button class="spectrum-Button spectrum-Button--sizeM spectrum-Button--outline spectrum-Button--primary spectrum-SplitButton-trigger">
46+
<button class="spectrum-Button spectrum-Button--sizeM spectrum-Button--outline spectrum-Button--primary spectrum-Button--iconOnly spectrum-SplitButton-trigger">
4747
<svg class="spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-SplitButton-icon" focusable="false" aria-hidden="true">
4848
<use xlink:href="#spectrum-css-icon-Chevron100" />
4949
</svg>
@@ -56,7 +56,7 @@ examples:
5656
markup: |
5757
<div class="spectrum-SplitButton">
5858
<button class="spectrum-Button spectrum-Button--sizeM spectrum-Button--outline spectrum-Button--secondary spectrum-SplitButton-action"><span class="spectrum-Button-label">Split Button</span></button>
59-
<button class="spectrum-Button spectrum-Button--sizeM spectrum-Button--outline spectrum-Button--secondary spectrum-SplitButton-trigger">
59+
<button class="spectrum-Button spectrum-Button--sizeM spectrum-Button--outline spectrum-Button--secondary spectrum-Button--iconOnly spectrum-SplitButton-trigger">
6060
<svg class="spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-SplitButton-icon" focusable="false" aria-hidden="true">
6161
<use xlink:href="#spectrum-css-icon-Chevron100" />
6262
</svg>
@@ -67,7 +67,7 @@ examples:
6767
<br>
6868
6969
<div class="spectrum-SplitButton spectrum-SplitButton--left">
70-
<button class="spectrum-Button spectrum-Button--sizeM spectrum-Button--outline spectrum-Button--secondary spectrum-SplitButton-trigger">
70+
<button class="spectrum-Button spectrum-Button--sizeM spectrum-Button--outline spectrum-Button--secondary spectrum-Button--iconOnly spectrum-SplitButton-trigger">
7171
<svg class="spectrum-Icon spectrum-UIIcon-ChevronDown100 spectrum-SplitButton-icon" focusable="false" aria-hidden="true">
7272
<use xlink:href="#spectrum-css-icon-Chevron100" />
7373
</svg>

.storybook/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
},
1212
"dependencies": {
1313
"@adobe/spectrum-css-workflow-icons": "^1.5.4",
14-
"@spectrum-css/expressvars": "^3.0.9",
1514
"@spectrum-css/tokens": "^13.2.0",
16-
"@spectrum-css/ui-icons": "^1.1.2",
17-
"@spectrum-css/vars": "^9.0.8"
15+
"@spectrum-css/ui-icons": "^1.1.2"
1816
},
1917
"devDependencies": {
2018
"@babel/core": "^7.22.1",

.storybook/project.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@
5050
"ci": {
5151
"cache": false,
5252
"commands": ["storybook build --config-dir . --webpack-stats-json"]
53+
},
54+
"docs": {
55+
"outputs": ["{workspaceRoot}/dist/preview"],
56+
"commands": [
57+
"storybook build --config-dir . --output-dir ../dist/preview"
58+
]
5359
}
5460
}
5561
},

components/card/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"peerDependencies": {
1818
"@spectrum-css/actionbutton": ">=5",
1919
"@spectrum-css/asset": ">=3",
20+
"@spectrum-css/checkbox": ">=8",
2021
"@spectrum-css/icon": ">=4",
2122
"@spectrum-css/quickaction": ">=3",
2223
"@spectrum-css/tokens": ">=13",

components/site/component.css

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ governing permissions and limitations under the License.
5555
}
5656

5757
.spectrum-CSSComponent-detailsTable {
58+
--mod-table-cursor-row-default: default;
59+
--mod-table-row-background-color-hover: transparent;
60+
--mod-table-divider-color: transparent;
61+
--mod-table-border-color: transparent;
62+
--mod-table-row-line-height: 1.6;
63+
5864
border-spacing: 0;
5965
margin-block-start: var(--spectrum-spacing-600);
6066
margin-block-end: 36px;
@@ -302,8 +308,8 @@ a[href*="spectrum.adobe.com"]
302308
/* CSS Example */
303309
.spectrum-CSSExample-example {
304310
background-color: var(
305-
--spectrum-background-base-color,
306-
var(--spectrum-gray-50)
311+
--spectrum-background-layer-1-color,
312+
var(--spectrum-gray-100)
307313
);
308314
}
309315

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
},
1515
"scripts": {
1616
"build": "yarn builder tag:component",
17-
"build:all": "run-s build:preview build:site migrate:preview",
1817
"build:preview": "nx build storybook",
1918
"build:site": "nx build docs",
2019
"builder": "nx run-many --target build --projects",
@@ -26,13 +25,12 @@
2625
"clean:preview": "nx clean storybook",
2726
"cleaner": "nx run-many --target clean --projects",
2827
"compare": "cross-env NODE_ENV=production node ./tasks/compare-compiled-output.js",
29-
"dev": "cross-env NODE_ENV=production nx start docs",
28+
"dev": "cross-env NODE_ENV=production nx run storybook:build:docs && nx start docs",
3029
"format": "yarn formatter tag:component",
3130
"formatter": "nx run-many --target format --verbose --projects",
3231
"preinstall": "command -v nvm >/dev/null 2>&1 && nvm use || exit 0",
3332
"lint": "yarn linter tag:component",
3433
"linter": "nx run-many --target lint --verbose --projects",
35-
"migrate:preview": "test -d .storybook/storybook-static && rimraf dist/preview && mv .storybook/storybook-static dist/preview || exit 0",
3634
"new": "nx run @spectrum-css/generator:new",
3735
"precommit": "lint-staged",
3836
"prepare": "husky install && run-p refresh:directory refresh:env && yarn refresh:config",
@@ -64,12 +62,9 @@
6462
"@commitlint/config-conventional": "^19.0.3",
6563
"@nx/devkit": "^18.0.4",
6664
"@spectrum-css/cyclebutton": "^3.1.3",
67-
"@spectrum-css/expressvars": "^3.0.9",
6865
"@spectrum-css/quickaction": "^3.1.1",
6966
"@spectrum-css/searchwithin": "^5.1.3",
7067
"@spectrum-css/splitbutton": "^8.1.2",
71-
"@spectrum-css/tokens": "^13.2.0",
72-
"@spectrum-css/vars": "^9.0.8",
7368
"at-rule-packer": "^0.4.2",
7469
"autoprefixer": "^10.4.17",
7570
"colors": "^1.4.0",

site/README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ site/
1212
│   ├── dependencies.pug - dependencies common to all pages
1313
│   ├── nav.pug - the navigation (within the sidebar)
1414
│   └── sidebar.pug - the left sidebar
15+
|   └── siteComponent.pug - template to build docs for components
1516
├── resources
1617
│ ├── css
1718
│ │   ├── docs.css - CSS related specifically to markup examples and component documentation
@@ -20,12 +21,8 @@ site/
2021
│ └── js
2122
│ ├── SpectrumSwitcher.js - A class that supports switching colorstops
2223
│ ├── enhancement.js - Enhancements that make examples interactive
23-
│ ├── polyfills.js - Polyfills for old browsers
2424
│ ├── site.js - The actual site navigation code
2525
│ └── typekit.js - Typekit that knows how to choose large/small kits based on the language attribute
26-
└── templates
27-
   ├── individualComponent.pug - template to build individual component packages
28-
   └── siteComponent.pug - template to build docs for components
2926
```
3027

3128
## Architecture
@@ -38,27 +35,27 @@ Because the dependencies included in the component example pages are sorted in t
3835

3936
## Viewing the site
4037

41-
1. Run `gulp dev` at the top level of the project and the site will build and open up in your browser.
38+
1. Run `yarn dev` at the top level of the project and the site will build and open up in your browser.
4239

4340
## Editing content
4441

45-
1. Run `gulp dev` at the top level of the project.
42+
1. Run `yarn dev` at the top level of the project.
4643
2. Edit the `*.pug` files in this folder as well as `includes/*.pug` and the site will live reload with your changes.
4744

4845
## Adding a new page
4946

50-
1. Run `gulp dev` at the top level of the project.
47+
1. Run `yarn dev` at the top level of the project.
5148
2. Create the Pug template file for the page in this folder by copying an existing page:
5249

5350
```shell
5451
cp getting-started.pug new-page.pug
5552
```
5653

57-
3. Manually add the new page to the navigation in `includes/nav.pug`, including the `.js-fastLoad` class on the link and the `is-selected` switch on the list item:
54+
3. Manually add the new page to the navigation in `includes/nav.pug`, including the `is-selected` switch on the list item:
5855

5956
```pug
6057
li.spectrum-SideNav-item(class=pageURL === 'new-page.html' ? 'is-selected' : '')
61-
a.spectrum-SideNav-itemLink.js-fastLoad(href='new-page.html') New Page
58+
a.spectrum-SideNav-itemLink(href='new-page.html') New Page
6259
```
6360

6461
4. Your new page will appear in the navigation. You can continue to edit it and it will live reload.
@@ -79,4 +76,4 @@ See the [internationalized typography example page](typography-i18n.html) for Ja
7976

8077
## Adding and editing resources
8178

82-
You can add and edit site resources to the `resources/` folder. These are copied directly into the root of the site and can be included as necessary. Editing existing resources while `gulp dev` is running will inject the new resources.
79+
You can add and edit site resources to the `resources/` folder. These are copied directly into the root of the site and can be included as necessary. Editing existing resources while `yarn dev` is running will inject the new resources.

site/get-started.pug

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
doctype html
2-
html(lang='en-US' dir="ltr").spectrum.spectrum--light.spectrum--medium
2+
html(lang='en-US' dir="ltr").spectrum
33
head
44
title Getting started - Spectrum CSS
55

@@ -29,7 +29,7 @@ html(lang='en-US' dir="ltr").spectrum.spectrum--light.spectrum--medium
2929
hr.spectrum-Divider.spectrum-Divider--large
3030

3131
section
32-
p.spectrum-Body.spectrum-Body--sizeL If youre ready to jump in, heres how to set up Spectrum CSS on our GitHub:
32+
p.spectrum-Body.spectrum-Body--sizeL If you're ready to jump in, here's how to set up Spectrum CSS on our GitHub:
3333

3434
ul.spectrum-Body.spectrum-Body--sizeL
3535
li
@@ -53,26 +53,24 @@ html(lang='en-US' dir="ltr").spectrum.spectrum--light.spectrum--medium
5353
p.spectrum-Body.spectrum-Body--sizeL First, install the required button dependencies by running:
5454

5555
pre.spectrum-CodeBlock
56-
code.spectrum-Code.spectrum-Code--sizeS.language-markup!=util.Prism.highlight('$ npm install @spectrum-css/vars @spectrum-css/button @spectrum-css/page', util.Prism.languages.markup, 'markup')
56+
code.spectrum-Code.spectrum-Code--sizeS.language-markup!=util.Prism.highlight('$ npm install @spectrum-css/tokens @spectrum-css/button @spectrum-css/page', util.Prism.languages.markup, 'markup')
5757

5858
p.spectrum-Body.spectrum-Body--sizeL Installed components will be available in the node_modules/@spectrum-css/ folder or on the Spectrum CSS NPM page.
5959

6060
h3.spectrum-Heading.spectrum-Heading--sizeS Setting up global variables
61-
p.spectrum-Body.spectrum-Body--sizeL Create a new HTML file (e.g., #[code.spectrum-Code.spectrum-Code--sizeS button.html]) in your projects root folder.
61+
p.spectrum-Body.spectrum-Body--sizeL Create a new HTML file (e.g., #[code.spectrum-Code.spectrum-Code--sizeS button.html]) in your project's root folder.
6262

63-
p.spectrum-Body.spectrum-Body--sizeL or displaying a button in Spectrums light color theme and medium scale, a couple of classes need to be added to the documents #[code.spectrum-Code.spectrum-Code--sizeS &lt;html&gt;] tag:
63+
p.spectrum-Body.spectrum-Body--sizeL or displaying a button in Spectrum's light color theme and medium scale, a couple of classes need to be added to the document's #[code.spectrum-Code.spectrum-Code--sizeS &lt;html&gt;] tag:
6464

6565
pre.spectrum-CodeBlock
66-
code.spectrum-Code.spectrum-Code--sizeS.language-markup!=util.Prism.highlight('<html class="spectrum spectrum--medium spectrum--light">', util.Prism.languages.markup, 'markup')
66+
code.spectrum-Code.spectrum-Code--sizeS.language-markup!=util.Prism.highlight('<body class="spectrum spectrum--medium spectrum--light">', util.Prism.languages.markup, 'markup')
6767

6868
h3.spectrum-Heading.spectrum-Heading--sizeS Adding Spectrum CSS
6969
p.spectrum-Body.spectrum-Body--sizeL Inside the #[code.spectrum-Code.spectrum-Code--sizeS &lt;head&gt;] tag, include the stylesheets that contain the design system tokens for global variables, scales, and color themes, as well as the stylesheets for the components themselves:
7070

7171
-
7272
htmlMarkup = util.Prism.highlight(`<head>
73-
<link rel="stylesheet" href="node_modules/@spectrum-css/vars/dist/spectrum-global.css">
74-
<link rel="stylesheet" href="node_modules/@spectrum-css/vars/dist/spectrum-medium.css">
75-
<link rel="stylesheet" href="node_modules/@spectrum-css/vars/dist/spectrum-light.css">
73+
<link rel="stylesheet" href="node_modules/@spectrum-css/tokens/dist/index.css">
7674
<link rel="stylesheet" href="node_modules/@spectrum-css/page/dist/index.css">
7775
<link rel="stylesheet" href="node_modules/@spectrum-css/button/dist/index.css">
7876
</head>`, util.Prism.languages.markup, 'markup');
@@ -88,18 +86,16 @@ html(lang='en-US' dir="ltr").spectrum.spectrum--light.spectrum--medium
8886
pre.spectrum-CodeBlock
8987
code.spectrum-Code.spectrum-Code--sizeS.language-markup!=htmlMarkup
9088

91-
p.spectrum-Body.spectrum-Body--sizeL Heres what your final button.html file should look like:
89+
p.spectrum-Body.spectrum-Body--sizeL Here's what your final button.html file should look like:
9290

9391
-
94-
htmlMarkup = util.Prism.highlight(`<html class="spectrum spectrum--light spectrum--medium">
92+
htmlMarkup = util.Prism.highlight(`<html>
9593
<head>
96-
<link rel="stylesheet" href="node_modules/@spectrum-css/vars/dist/spectrum-global.css">
97-
<link rel="stylesheet" href="node_modules/@spectrum-css/vars/dist/spectrum-medium.css">
98-
<link rel="stylesheet" href="node_modules/@spectrum-css/vars/dist/spectrum-light.css">
94+
<link rel="stylesheet" href="node_modules/@spectrum-css/tokens/dist/index.css">
9995
<link rel="stylesheet" href="node_modules/@spectrum-css/page/dist/index.css">
10096
<link rel="stylesheet" href="node_modules/@spectrum-css/button/dist/index.css">
10197
</head>
102-
<body>
98+
<body class="spectrum spectrum--light spectrum--medium">
10399
<button class="spectrum-Button spectrum-Button--fill spectrum-Button--accent spectrum-Button--sizeM">
104100
<span class="spectrum-Button-label">Button</span>
105101
</button>
@@ -115,7 +111,7 @@ html(lang='en-US' dir="ltr").spectrum.spectrum--light.spectrum--medium
115111
a(href="#contribute").spectrum-BigSubtleLink Contribute to Spectrum CSS
116112
hr.spectrum-Divider.spectrum-Divider--large
117113

118-
p.spectrum-Body.spectrum-Body--sizeL Wed love for you to contribute to the Spectrum CSS project. Review the <a href="https://github.com/adobe/spectrum-css/blob/main/.github/CONTRIBUTING.md" class="spectrum-Link spectrum-Link--quiet" target="_blank">contribution guidelines on our GitHub</a> to get started.
114+
p.spectrum-Body.spectrum-Body--sizeL We'd love for you to contribute to the Spectrum CSS project. Review the <a href="https://github.com/adobe/spectrum-css/blob/main/.github/CONTRIBUTING.md" class="spectrum-Link spectrum-Link--quiet" target="_blank">contribution guidelines on our GitHub</a> to get started.
119115

120116
include includes/footer.pug
121117

0 commit comments

Comments
 (0)