Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Clean outdated properties #6073

Merged
merged 2 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ Notice `.card` does not appear anywhere. We would then apply styles to the host
Modifier classes on the "block" (host element) can often be written by reflecting the prop and selecting it directly via an attribute selector:

```scss
:host([color="blue"]) {
:host([kind="success"]) {
}
```

Expand Down
41 changes: 0 additions & 41 deletions conventions/Styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,47 +30,6 @@ Add a class to handle the logic in the component class.
}
```

## Color

If a component has multiple color themes (for example Blue, Red, Green, and Yellow) representing various state implement a `color` prop and reflect it to an attributes.

```tsx
enum Colors {
red = "red",
blue = "blue",
green = "green",
yellow = "yellow",
}

export class Component {

// ...

@Prop({ reflect: true }) color: Colors = 'blue'

// ...
```

You can then use the `:host()` selector to define your custom colors:

```scss
:host([color="blue"]) {
.something {
// make it blue
}
}

:host([color="red"]) {
.something {
// make it red
}
}
```

**Discussed In**:

- https://github.com/Esri/calcite-components/pull/24/files/3446c89010e3ef0421803d68d627aba2e7c4bfa0#r289427838

## Light Theme/Dark Theme

In the [global CSS file](https://github.com/Esri/calcite-components/blob/master/src/assets/styles/global.scss), we specify the values of each color for both light and dark theme. This enables theming to be inherited throughout a component tree. Consider this valid example:
Expand Down
2 changes: 1 addition & 1 deletion src/05-custom-theme.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export const Template = () =>
</calcite-tabs>
<calcite-loader class="chromatic-ignore"></calcite-loader>
<label>
<calcite-switch scale="m" checked color="red"> </calcite-switch>
<calcite-switch scale="m" checked> </calcite-switch>
Red switch scale medium
</label>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/components/list/list.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,23 +167,23 @@ export const startAndEndContentSlots = (): string => html`<calcite-list ${knobsH
<span slot="content-start">Some value or something and a <b>thing</b>.</span>
<div slot="content-end" style="display: flex; justify-content: flex-end">
<calcite-chip class="list-chip" icon="ribbon-rosette" scale="s">Review</calcite-chip>
<calcite-chip class="list-chip" icon="globe" scale="s" color="green">Good</calcite-chip>
<calcite-chip class="list-chip" icon="globe" scale="s">Good</calcite-chip>
</div>
</calcite-list-item>
<calcite-list-item>
<calcite-action slot="actions-end" icon="ellipsis"> </calcite-action>
<calcite-icon icon="user" scale="m" slot="content-start"></calcite-icon>
<span slot="content-start">Some value or something and a <b>thing</b>.</span>
<div slot="content-end" style="display: flex; justify-content: flex-end">
<calcite-chip class="list-chip" icon="globe" scale="s" color="green">Good</calcite-chip>
<calcite-chip class="list-chip" icon="globe" scale="s">Good</calcite-chip>
</div>
</calcite-list-item>
<calcite-list-item>
<calcite-action slot="actions-end" icon="ellipsis"> </calcite-action>
<calcite-icon icon="user" scale="m" slot="content-start"></calcite-icon>
<span slot="content-start">Some value or something and a <b>thing</b>.</span>
<div slot="content-end" style="display: flex; justify-content: flex-end">
<calcite-chip class="list-chip" icon="bell" color="red" scale="s">Halp!</calcite-chip>
<calcite-chip class="list-chip" icon="bell" scale="s">Halp!</calcite-chip>
</div>
</calcite-list-item>
</calcite-list> `;
Expand Down
2 changes: 1 addition & 1 deletion src/components/modal/usage/Basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Customize the modal by passing your content into multiple named slots: `header`
<calcite-modal aria-labelledby="modal-title" open>
<h3 slot="header" id="modal-title">Title of the modal</h3>
<div slot="content">The actual content of the modal</div>
<calcite-button slot="back" color="neutral" appearance="outline" icon="chevron-left" width="full">
<calcite-button slot="back" kind="neutral" appearance="outline" icon="chevron-left" width="full">
Back
</calcite-button>
<calcite-button slot="secondary" width="full" appearance="outline"> Cancel </calcite-button>
Expand Down
8 changes: 3 additions & 5 deletions src/demos/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ <h1 style="margin: 0 auto; text-align: center">List</h1>
<span slot="content-start">Some value or something and a <b>thing</b>.</span>
<div slot="content-end" style="display: flex; justify-content: flex-end">
<calcite-chip class="list-chip" icon="ribbon-rosette" scale="s">Review</calcite-chip>
<calcite-chip class="list-chip" icon="globe" scale="s" color="green">Good</calcite-chip>
<calcite-chip class="list-chip" icon="globe" scale="s">Good</calcite-chip>
</div>
</calcite-list-item>

Expand All @@ -360,9 +360,7 @@ <h1 style="margin: 0 auto; text-align: center">List</h1>
</calcite-action>
<calcite-icon icon="user" scale="m" slot="content-start"></calcite-icon>
<span slot="content-start">Some value or something and a <b>thing</b>.</span>
<div slot="content-end" style="display: flex; justify-content: flex-end">
<calcite-chip class="list-chip" icon="globe" scale="s" color="green">Good</calcite-chip>
</div>
<div slot="content-end" style="display: flex; justify-content: flex-end"></div>
</calcite-list-item>

<calcite-list-item>
Expand All @@ -371,7 +369,7 @@ <h1 style="margin: 0 auto; text-align: center">List</h1>
<calcite-icon icon="user" scale="m" slot="content-start"></calcite-icon>
<span slot="content-start">Some value or something and a <b>thing</b>.</span>
<div slot="content-end" style="display: flex; justify-content: flex-end">
<calcite-chip class="list-chip" icon="bell" color="red" scale="s">Halp!</calcite-chip>
<calcite-chip class="list-chip" icon="bell" scale="s">Halp!</calcite-chip>
</div>
</calcite-list-item>
</calcite-list>
Expand Down