Skip to content

Commit

Permalink
feat(well)!: migrate to use spectrum-tokens
Browse files Browse the repository at this point in the history
BREAKING CHANGE: migrates Well to use spectrum-tokens
  • Loading branch information
Rajdeep Chandra authored and pfulton committed Sep 7, 2023
1 parent 989efef commit b362c23
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 19 deletions.
2 changes: 1 addition & 1 deletion components/well/gulpfile.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require("@spectrum-css/component-builder");
module.exports = require("@spectrum-css/component-builder-simple");
17 changes: 8 additions & 9 deletions components/well/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@ governing permissions and limitations under the License.
*/

.spectrum-Well {
--spectrum-well-padding: var(--spectrum-global-dimension-size-200);
--spectrum-well-border-width: var(--spectrum-alias-border-size-thin);
--spectrum-well-margin-top: var(--spectrum-global-dimension-size-50);
--spectrum-well-min-width: var(--spectrum-global-dimension-size-3000);
--spectrum-well-border-width: var(--spectrum-border-width-100);
}

.spectrum-Well {
text-align: start;
display: block;
min-inline-size: var(--spectrum-well-min-width);
padding: var(--spectrum-well-padding);
margin-block-start: var(--spectrum-well-margin-top);
border-width: var(--spectrum-well-border-width);
min-inline-size: var(--mod-well-min-width, var(--spectrum-well-min-width));
padding: var(--mod-well-padding, var(--spectrum-well-padding));
margin-block-start: var(--mod-well-margin-top, var(--spectrum-well-margin-top));
border-width: var(--mod-well-border-width, var(--spectrum-well-border-width));
border-style: solid;
border-radius: var(--spectrum-alias-border-radius-regular);
border-radius: var(--mod-well-border-radius, var(--spectrum-well-border-radius));
background-color: var(--mod-well-background-color, rgba(var(--spectrum-gray-800-rgb), 0.02));
border-color: var(--mod-well-border-color, var(--spectrum-well-border-color));
}
9 changes: 9 additions & 0 deletions components/well/metadata/mods.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
| Modifiable Custom Properties |
| ----------------------------- |
| `--mod-well-background-color` |
| `--mod-well-border-color` |
| `--mod-well-border-radius` |
| `--mod-well-border-width` |
| `--mod-well-margin-top` |
| `--mod-well-min-width` |
| `--mod-well-padding` |
2 changes: 2 additions & 0 deletions components/well/metadata/well.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ examples:
markup: |
<h3 class="spectrum-Heading spectrum-Heading--sizeXXS">Well Label (Optional)</h3>
<span class="spectrum-Well">
<p class="spectrum-Body">
<em>Well done is better than well said.</em>
<br>
<strong>Benjamin Franklin</strong>
<br><br>
Well said Ben!
</p>
</span>
6 changes: 3 additions & 3 deletions components/well/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
"build": "gulp"
},
"peerDependencies": {
"@spectrum-css/vars": ">=9"
"@spectrum-css/tokens": ">=11"
},
"devDependencies": {
"@spectrum-css/component-builder": "^4.0.14",
"@spectrum-css/vars": "^9.0.8",
"@spectrum-css/component-builder-simple": "^2.0.17",
"@spectrum-css/tokens": "^11.2.1",
"gulp": "^4.0.0"
},
"publishConfig": {
Expand Down
1 change: 0 additions & 1 deletion components/well/stories/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { html } from "lit";
import { classMap } from "lit/directives/class-map.js";

import "../index.css";
import "../skin.css";

export const Template = ({
rootClass = "spectrum-Well",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ Copyright 2023 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

.spectrum-Well {
background-color: var(--spectrum-well-background-color);
border-color: var(--spectrum-well-border-color);
}
@container (--system: express) {}
12 changes: 12 additions & 0 deletions components/well/themes/spectrum.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*!
Copyright 2023 Adobe. All rights reserved.
This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

@container (--system: spectrum) {}

0 comments on commit b362c23

Please sign in to comment.