Skip to content

Commit 215bbb2

Browse files
committed
some cleanup before code review
1 parent ac4f88a commit 215bbb2

File tree

12 files changed

+45
-102
lines changed

12 files changed

+45
-102
lines changed

showcase/app/components/page-carbonization/foundations/color.gts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { eq, notEq, and } from 'ember-truth-helpers';
55

66
import ShwTextH1 from 'showcase/components/shw/text/h1';
77
import ShwCarbonizationComparisonGrid from 'showcase/components/shw/carbonization/comparison-grid';
8-
import ShwCarbonizationTokenPreviewHdsColor from 'showcase/components/shw/carbonization/token-preview/hds-color';
8+
import ShwCarbonizationTokenPreviewColor from 'showcase/components/shw/carbonization/token-preview/color';
99

1010
import type { DesignToken } from '../../../../types/design-token';
1111

@@ -25,7 +25,7 @@ const ColorCarbonization: TemplateOnlyComponent = <template>
2525
{{#if (and (eq token.$type "color") (notEq token.name undefined))}}
2626
<ShwCarbonizationComparisonGrid @label={{tokenShortName token}}>
2727
<:theming as |T|>
28-
<ShwCarbonizationTokenPreviewHdsColor
28+
<ShwCarbonizationTokenPreviewColor
2929
@mode={{T.context}}
3030
@tokenName={{token.name}}
3131
/>

showcase/app/components/shw/carbonization/comparison-grid/item.gts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default class ShwCarbonizationComparisonGridItem extends Component<ShwCar
3737
get classNames(): string {
3838
const classes = ['shw-carbonization-comparison-grid__item'];
3939

40-
// add a class based on `this.area`
40+
// add a class based on `this.areaName`
4141
classes.push(
4242
`shw-carbonization-comparison-grid__item--area-${this.areaName}`,
4343
);

showcase/app/index.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,9 @@
5757
<script type="module"
5858
src="https://1.www.s81c.com/common/carbon/web-components/version/v2.40.1/text-input.min.js"></script>
5959
<!-- This contains global styles and CSS resets too! -->
60-
<!-- <link
61-
rel="stylesheet"
62-
href="https://1.www.s81c.com/common/carbon-for-ibm-dotcom/tag/v1/latest/plex.css" /> -->
6360
<link rel="stylesheet" href="https://1.www.s81c.com/common/carbon/web-components/tag/latest/themes.css" />
6461
<link rel="stylesheet" href="https://1.www.s81c.com/common/carbon/plex/sans.css" />
6562
<style type="text/css">
66-
/* manually setting the default font */
67-
/* body {
68-
font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
69-
} */
70-
7163
/* Suppress custom element until styles are loaded */
7264
cds-badge-indicator:not(:defined),
7365
cds-button:not(:defined),

showcase/app/services/shw-theming.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const updatePageStylesheets = (currentStylesheet: ShwStylesheets) => {
6363
});
6464
};
6565

66-
export const LOCALSTORAGE_CURRENT_STYLESHEET = 'shw-theming-current-stylesheet';
66+
const LOCALSTORAGE_CURRENT_STYLESHEET = 'shw-theming-current-stylesheet';
6767
export default class ShwThemingService extends HdsThemingService {
6868
@service declare readonly hdsTheming: HdsThemingService;
6969

showcase/app/styles/_globals.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
@use "./typography" as *;
7-
@use '@carbon/type' as carbon-type;
87

98
*,
109
*::before,

showcase/app/styles/app.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090

9191
// carbonization
9292

93-
@use "./showcase-components/carbonization/cds-theming";
9493
@use "./showcase-components/carbonization/comparison-grid";
9594
@use "./showcase-components/carbonization/style-preview-typography";
9695
@use "./showcase-components/carbonization/token-preview-color";

showcase/app/styles/showcase-components/carbonization/cds-theming.scss

Lines changed: 0 additions & 53 deletions
This file was deleted.

showcase/app/styles/showcase-components/carbonization/comparison-grid.scss

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,23 @@
4545
margin-bottom: 0;
4646
}
4747

48-
// THEMING BACKGROUNDS
48+
// THEMING AREAS
4949

5050
.shw-carbonization-comparison-grid__item-content {
5151
padding: 8px;
5252
color: var(--content-foreground-color);
5353
background-color: var(--content-background-color);
5454
}
5555

56+
// area: HDS "default"
57+
5658
.shw-carbonization-comparison-grid__item--area-default {
5759
--content-foreground-color: var(--token-color-foreground-primary);
5860
--content-background-color: var(--token-color-surface-primary);
5961
}
6062

63+
// area: HDS carbonized
64+
6165
// TODO replace the hex values (copied from the `--cds-background` themed variable) with CSS design tokens from our theming
6266
.shw-carbonization-comparison-grid__item--area-cds-g0 {
6367
--content-foreground-color: #161616;
@@ -79,6 +83,8 @@
7983
--content-background-color: #161616;
8084
}
8185

86+
// area: CDS web components
87+
8288
.shw-carbonization-comparison-grid__item--area-cwc-g0 {
8389
--content-foreground-color: #{map.get(cdsThemes.$white, text-primary)};
8490
--content-background-color: #{map.get(cdsThemes.$white, background)};
@@ -99,17 +105,25 @@
99105
--content-background-color: #{map.get(cdsThemes.$g100, background)};
100106
}
101107

102-
// if we had access to the CSS variables directly (without importing also the resets) we could do just this
103-
// https://github.com/carbon-design-system/ibm-products/blob/main/packages/ibm-products-web-components/examples/tearsheet/src/styles.scss#L16-L17
104-
// https://github.com/carbon-design-system/carbon-components-angular/blob/master/src/theme/theme.stories.ts#L43-L44
105-
// .shw-carbonization-comparison-grid__item--area-cwc-g0,
106-
// .shw-carbonization-comparison-grid__item--area-cwc-g10,
107-
// .shw-carbonization-comparison-grid__item--area-cwc-g90,
108-
// .shw-carbonization-comparison-grid__item--area-cwc-g100 {
109-
// --content-foreground-color: var(--cds-text-primary);
110-
// --content-background-color: var(--cds-background);
111-
// }
108+
// WEB COMPONENTS local styling
109+
// these come from https://1.www.s81c.com/common/carbon/web-components/tag/latest/themes.css
110+
// they are used in selectors like `:host(.cds-theme-zone-g10), .cds-theme-zone-g10` to apply specific CSS variables for a theme/mode
111+
112+
// see: https://github.com/carbon-design-system/carbon/blob/main/packages/web-components/docs/carbon-cdn-style-helpers.mdx#carbon-theme-zoning-classes
113+
.cds-theme-zone-white,
114+
.cds-theme-zone-g10,
115+
.cds-theme-zone-g90,
116+
.cds-theme-zone-g100 {
117+
font-family: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
112118

119+
code {
120+
font-family: 'IBM Plex Mono', Menlo, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Courier, monospace
121+
}
122+
123+
button, select, input, textarea {
124+
font-family: inherit
125+
}
126+
}
113127

114128
// DEBUG
115129

showcase/app/styles/showcase-pages/carbonization/segmented-group.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,3 @@ body.page-carbonization-components-segmented-group {
1313
align-items: end;
1414
}
1515
}
16-
17-
18-

0 commit comments

Comments
 (0)