Skip to content

Commit

Permalink
Tab style v11 (#2376)
Browse files Browse the repository at this point in the history
* Update style.mdx

updating color and spacing tokens and images

* updates

updated images, structure, sizes

* Update style.mdx

* Update style.mdx

* image update

updated images to use plex sans instead of mono

* update tables

split icon-only modifiers into new table, updated images, added sizes into main structure tables

* Updated anchor links & images

separated structure images out and added anchor links

* update em dash

updated some dashes

* updated lines in images

got rid of random line in two images

* Updated images

Updated images to 12 column fixed specs

* En dash update

made sure all the dashes were en dashes

* Update tab-style-8b.png

updated image with new column structure
  • Loading branch information
kingtraceyj committed Jun 9, 2021
1 parent f6faf41 commit 9aee2c0
Show file tree
Hide file tree
Showing 11 changed files with 229 additions and 20 deletions.
Binary file modified src/pages/components/tabs/images/tab-style-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/pages/components/tabs/images/tab-style-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/pages/components/tabs/images/tab-style-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/pages/components/tabs/images/tab-style-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/pages/components/tabs/images/tab-style-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/pages/components/tabs/images/tab-style-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/pages/components/tabs/images/tab-style-7b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/pages/components/tabs/images/tab-style-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/pages/components/tabs/images/tab-style-8b.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
249 changes: 229 additions & 20 deletions src/pages/components/tabs/style.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,153 @@ description:
tabs: ['Usage', 'Style', 'Code', 'Accessibility']
---

<AnchorLinks>

<AnchorLink>Color</AnchorLink>
<AnchorLink>Typography</AnchorLink>
<AnchorLink>Structure</AnchorLink>

</AnchorLinks>

## Color

| Class | Property | Color token |
| ------------------------------- | ------------- | ----------------- |
| `.bx--tabs__nav-link` | text color | `$text-02` |
| `.bx--tabs__nav-item` | border-bottom | `$ui-03` |
| `.bx--tabs__nav-link:selected` | text color | `$text-01` |
| `.bx--tabs__nav-item--selected` | border-bottom | `$interactive-04` |
### Line tabs

| State | Element | Property | Color token |
| -------- | --------------------- | ---------------- | ---------------------------------------------- |
| Enabled | Background | background-color | transparent |
| | Label | text-color | `$text-secondary` |
| | Icon | svg | `$icon-secondary` |
| | Background | border-bottom | `$border-subtle` |
| | Scrollable icon | svg | `$icon-primary` |
| | Scrollable fade | background-color | 8px, linear-gradient white to 100% transparent |
| | Scrollable background | background-color | `$background` |
| Selected | Label | text-color | `$text-primary` |
| | Icon | svg | `$icon-primary` |
| | Background | border-bottom | `$interactive` |

<div className="image--fixed">

![Example of selected and enabled line tabs](images/tab-style-1.png)

</div>

<Caption>Example of selected and enabled line tabs.</Caption>

<br />

#### Interactive states

<br />

| State | Element | Property | Color token |
| -------------- | --------------------- | ---------------- | ------------------- |
| Hover | Background | border-bottom | `$interactive` |
| | Label | text-color | `$text-primary` |
| | Icon | svg | `$icon-primary` |
| | Scrollable background | background-color | `$background-hover` |
| Active | Scrollable background | background-color | `$layer-accent` |
| Focus | Scrollable background | border | `$focus` |
| Focus-enabled | Label | text-color | `$text-secondary` |
| | Background | border | `$interactive` |
| | Icon | svg | `$icon-secondary` |
| Focus-selected | Label | text-color | `$text-primary` |
| | Background | border | `$interactive` |
| | Icon | svg | `$icon-primary` |
| Disabled | Label | text-color | `$text-disabled` |
| | Icon | svg | `$icon-disabled` |
| | Background | background-color | `$icon-disabled` |

<div className="image--fixed">

![Examples of hover, focus-enabled, focus-selected, and disabled states](images/tab-style-3.png)

</div>

<Caption>
Examples of hover, focus-enabled, focus-selected, and disabled states for line
tabs.
</Caption>

### Interactive states
<div className="image--fixed">

![Examples of enabled, hover, active, and disabled states for scrollable line tabs](images/tab-style-4.png)

</div>

<Caption>
Examples of enabled, hover, active, and disabled states for scrollable line
tabs.
</Caption>

### Contained tabs

| State | Element | Property | Color token |
| -------- | --------------- | ---------------- | --------------------- |
| Enabled | Background | background-color | `$layer-accent` |
| | Label | text-color | `$text-secondary` |
| | Icon | svg | `$icon-secondary` |
| | Background | border-right | `$border-strong` |
| | Scrollable icon | svg | `$icon-secondary` |
| | Label | text-color | `$text-primary` |
| Selected | Background | background-color | `$layer` |
| | Icon | svg | `$icon-primary` |
| | Background | border-top | `$border-interactive` |

<div className="image--fixed">

![Examples of selected and enabled contained tabs](images/tab-style-2.png)

</div>

<Caption>Examples of selected and enabled contained tabs.</Caption>

<br />

#### Interactive states

<br />

| State | Element | Property | Color token |
| -------------- | --------------------- | ---------------- | ---------------------- |
| Hover | Background | background-color | `$layer-accent-hover` |
| | Label | text-color | `$text-primary` |
| | Icon | svg | `$icon-primary` |
| | Scrollable background | background-color | `$layer-accent-hover` |
| Active | Scrollable background | background-color | `$layer-accent-active` |
| Focus | Scrollable background | border | `$focus` |
| Focus-enabled | Label | text-color | `$text-secondary` |
| | Background | background-color | `$layer-accent` |
| | Icon | svg | `$icon-secondary` |
| Focus-selected | Label | text-color | `$text-primary` |
| | Background | background-color | `$layer` |
| | Icon | svg | `$icon-primary` |
| Disabled | Label | text-color | `$text-disabled` |
| | Icon | svg | `$icon-disabled` |
| | Background | background-color | `$icon-disabled` |
| | Border | border-right | `$border-disabled` |

<div className="image--fixed">

| Class | Property | Color token |
| --------------------------- | ------------- | ----------- |
| `.bx--tabs__nav-link:hover` | text color | `$text-01` |
| `.bx--tabs__nav-item:hover` | border-bottom | `$ui-04` |
| `.bx--tabs__nav-item:focus` | border | `$focus` |
![Hover, focus-enabled, focus-selected, and disabled states for contained
tabs.](images/tab-style-5.png)

</div>

<Caption>
Hover, focus-enabled, focus-selected, and disabled states for contained tabs.
</Caption>

<div className="image--fixed">

![Enabled, hover, active, and focus states for contained scrollable tabs.](images/tab-style-6.png)

</div>

<Caption>
Examples of enabled, hover, active, and focus states for contained scrollable
tabs.
</Caption>

## Typography

Expand All @@ -33,17 +164,95 @@ Tab label should be set in sentence case, and should not exceed three words.

## Structure

| Class | Property | px / rem | Spacing token |
| --------------------- | --------------------------- | -------- | ------------- |
| `.bx--tabs__nav-item` | border-bottom | 2px ||
| `.bx--tabs__nav-link` | padding-left, padding-right | 16 / 1 | `$spacing-05` |
| `.bx--tabs__nav-link` | padding-top, padding-bottom | 8 / 0.5 | `$spacing-03` |
| `bx--tabs__nav-item` | margin-left | 1px | - |
### Line tabs

| Element | Property | px / rem | Spacing token |
| --------------- | --------------------------- | ---------- | ------------- |
| Tab | height | 40 / 2.5 ||
| | border-bottom | 2px ||
| | width | auto-width ||
| | margin-left | 1px ||
| Label | padding-left, padding-right | 16 / 1 | `$spacing-05` |
| | padding-top, padding-bottom | 8 / 0.5 | `$spacing-03` |
| Icon | padding-right | 16 / 1 | `$spacing-05` |
| | padding-left | 8 / 0.5 | `$spacing-03` |
| | svg | 16 x 16 ||
| Scrollable icon | svg | 16 x 16 ||

<div className="image--fixed">

![Structure and spacing measurements for line tabs.](images/tab-style-7.png)

</div>

<Caption>Structure and spacing measurements for line tabs | px / rem</Caption>

<br />

#### Icon-only modifier

<br />

| Element | Property | px / rem | Spacing token |
| -------- | ------------- | -------- | ------------- |
| Tab (md) | height, width | 40 / 2.5 ||
| | svg | 16 x 16 ||
| Tab (lg) | height, width | 48 / 3 ||
| | svg | 20 x 20 ||

<div className="image--fixed">

![Structure and spacing measurements for line tabs in px and rem](images/tab-style-7b.png)

</div>

<Caption>
Structure and spacing measurements for icon-only line tabs | px / rem
</Caption>

### Contained tabs

| Element | Property | px / rem | Spacing token |
| --------------------- | --------------------------- | ---------------- | ------------- |
| Tab | height | 40 / 2.5 ||
| | border-top | 2px ||
| | width | auto-width, grid ||
| Label | padding-left, padding-right | 16 / 1 | `$spacing-05` |
| Icon | padding-right | 16 / 1 | `$spacing-05` |
| | padding-left | 16 / 1 | `$spacing-05` |
| | svg | 16 x 16 ||
| Tab | border-right | 1px ||
| Scrollable icon | svg | 16 x 16 ||
| Scrollable background | border-right, border-left | 1px ||

<div className="image--fixed">

![Structure and spacing measurements for contained tabs in px and rem](images/tab-style-8.png)

</div>

<Caption>
Structure and spacing measurements for contained tabs | px / rem
</Caption>

<br />

#### Icon-only modifier

<br />

| Element | Property | px / rem | Spacing token |
| -------- | ------------- | -------- | ------------- |
| Tab (lg) | height, width | 48 / 3 ||
| | svg | 20 x 20 ||

<div className="image--fixed">

![Structure and spacing measurements for tabs](images/tab-style-1.png)
![Structure and spacing measurements for icon-only contained tabs in px and
rem](images/tab-style-8b.png)

</div>

<Caption>Structure and spacing measurements for tile | px / rem</Caption>
<Caption>
Structure and spacing measurements for icon-only contained tabs | px / rem
</Caption>

0 comments on commit 9aee2c0

Please sign in to comment.