Skip to content

Commit b176b6d

Browse files
TarunAdobecastastrophe
authored andcommitted
chore: update styling guide (#5437)
* chore: add styling guide * chore: remove spectrum-config and update other docs * fix: update yarn new-package to not depend on spectrum-css * chore: update styling guide * chore: remove formating from plopfile
1 parent 8643af5 commit b176b6d

File tree

6 files changed

+13
-45
lines changed

6 files changed

+13
-45
lines changed

projects/documentation/content/guides/generating-components.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ _Note_ that your component name should be provided in kebab case and should rela
2222
- [new-component-name]
2323
- src
2424
- index.ts
25-
- spectrum-[new-component-name].css
26-
- [new-component-name]-overrides.css
2725
- [new-component-name].css
2826
- [NewComponentName].ts
2927
- stories

projects/documentation/content/guides/styling-components.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ This document outlines the details of the CSS styling for Spectrum Web Component
1313

1414
For each component in the project, there are up to 3 CSS files:
1515

16-
- `spectrum-[component-name].css` - This is the main CSS file for the component that is generated by the last build from the Spectrum CSS project before we removed that package as a dependency.
17-
- `[component-name]-overrides.css` - This is the CSS file for the component that contains the system overrides which take different values in different themes. It was also generated by the last build from the Spectrum CSS project before we removed that package as a dependency.
1816
- `[component-name].css` - This is the main CSS file which imports the `spectrum-[component-name].css` and `[component-name]-overrides.css` files and additionally contains the component's custom styles which were not part of the Spectrum CSS project.
1917

2018
### How to update the component styling
@@ -37,20 +35,11 @@ Example:
3735

3836
This will just work! As long as the `--spectrum-component-height-300` variable exists in the tokens package.
3937

40-
- If it's an update to how a component looks in one particular theme, it belongs in `[component-name]-overrides.css`.
41-
42-
The process to update the overrides file involves a few extra steps:
43-
44-
1. Update the `[component-name]-overrides.css` file to contain the new styles.
45-
2. Make sure the new `--system-` variable exists in the tokens package. This variable can be found in the `tools/styles/tokens/[express | spectrum]/system-theme-bridge.css` file or the `tools/styles/tokens-v2/system-theme-bridge.css` file depending on the theme.
46-
3. If the variable doesn't exist, we will need to add it to the correct file.
47-
4838
## Global styling
4939

5040
SWC project uses styles package to manage the global css tokens for all three themes. The styles package can be found in `tools/styles`. There is one very small caveat in the way we manage the styles package. We have two different tokens packages, one for the express + spectrum theme and one for the spectrum 2 theme.
5141

5242
- `styles/tokens` - This is the tokens package for the Express + Spectrum theme.
53-
- `styles/tokens-v2` - This is the tokens package for the Spectrum 2 theme.
5443

5544
NOTE: In all likelihood, you would only need to do minor changes to the styles package. However, if you feel like you need to make major changes to the styles package, the correct approach would be to start a discussion among the team and figure out a plan together.
5645

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
export const argTypes = {
2-
3-
}
1+
export const argTypes = {};

projects/templates/plop-templates/component-overrides.css.hbs

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { {{ className name }} } from './src/{{className name}}.js';
32

43
customElements.define('{{> tagnamePartial }}', {{ className name }});
@@ -7,4 +6,4 @@ declare global {
76
interface HTMLElementTagNameMap {
87
'{{> tagnamePartial }}': {{ className name }};
98
}
10-
}
9+
}
Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
/*
2-
Copyright 2025 Adobe. All rights reserved.
3-
This file is licensed to you under the Apache License, Version 2.0 (the "License");
4-
you may not use this file except in compliance with the License. You may obtain a copy
5-
of the License at http://www.apache.org/licenses/LICENSE-2.0
6-
7-
Unless required by applicable law or agreed to in writing, software distributed under
8-
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9-
OF ANY KIND, either express or implied. See the License for the specific language
10-
governing permissions and limitations under the License.
11-
*/
12-
13-
@import './spectrum-{{ name }}.css';
14-
@import './{{ name }}-overrides.css';
1+
/**
2+
* Copyright 2025 Adobe. All rights reserved.
3+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License. You may obtain a copy
5+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
*
7+
* Unless required by applicable law or agreed to in writing, software distributed under
8+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9+
* OF ANY KIND, either express or implied. See the License for the specific language
10+
* governing permissions and limitations under the License.
11+
*/

0 commit comments

Comments
 (0)