Skip to content

Commit

Permalink
feat(tabs-extended): update to v11 styles and deprecate vertical va…
Browse files Browse the repository at this point in the history
…riant (#11086)

* feat(tabs): use v11 styles for extended tabs component
  • Loading branch information
emyarod authored Nov 17, 2023
1 parent 90e566e commit 6caf5e7
Show file tree
Hide file tree
Showing 16 changed files with 451 additions and 875 deletions.
12 changes: 10 additions & 2 deletions docs/dotcom-v2-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ For Carbon v11 migration guidance, see their
| scroll-animations | No API changes. |
| search-with-typeahead | No API changes. |
| table-of-contents | No API changes. |
| tabs-extended-media | Deprecated in favor of `tabs-extended`. |
| tabs-extended | View [changes](#tabs-extended) |
| tabs-extended-media | Deprecated in favor of [`tabs-extended`](#tabs-extended). |
| tag-group | Deprecated in favor of wrapping Carbon `tag` in a parent container. |
| tag-link | Deprecated in favor of Carbon `tag`. |
| universal-banner | View [changes](#universal-banner) |
Expand Down Expand Up @@ -100,7 +101,8 @@ For Carbon v11 migration guidance, see their
### Card group

- Removed `outline` property
- New grid mode options: `Default` with a 32px gap, `Narrow` with a 16px gap, and `Condensed` with no gaps inbetween
- New grid mode options: `Default` with a 32px gap, `Narrow` with a 16px gap,
and `Condensed` with no gaps inbetween
- Grid mode options `Collapsed` has been replaced with `Condensed`
- Removed grid mode option `Border`
- Deprecated `card-link` option in Card group
Expand Down Expand Up @@ -181,8 +183,14 @@ information.
- `link-list-item-card-cta` has been replaced with `link-list-item-cta`

### Quote

- Removed `color-scheme` `inverse` option in favor of `callout-quote (inverse)`

### Tabs extended

- `vertical` variant has been deprecated
- `contained` type has been added

### Universal banner

- `universal-banner` renamed to `global-banner`
6 changes: 2 additions & 4 deletions packages/carbon-web-components/src/components/tabs/tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ $inset-transition: inset 110ms motion(standard, productive);
flex: 1 1 0%;
position: relative;
overflow: scroll;
height: 42px; // for some reason, overflow: hidden shrinks the content
height: $spacing-09; // for some reason, overflow: hidden shrinks the content
scrollbar-width: none;

&::-webkit-scrollbar {
display: none;
}
}

/* Set to zero-slecificity so it can be overridden by dynamic stylesheet */
/* Set to zero-specificity so it can be overridden by dynamic stylesheet */
/* stylelint-disable-next-line selector-pseudo-class-no-unknown */
:where(.#{$prefix}--tabs-nav-content) {
position: absolute;
Expand Down Expand Up @@ -80,11 +80,9 @@ $inset-transition: inset 110ms motion(standard, productive);
@include focus-outline('reset');
@include type-style('body-compact-01');

display: flex;
align-items: center;
width: 100%;
overflow: hidden;
max-width: $spacing-13;
padding: $spacing-04 $spacing-05 $spacing-03;
border-bottom: $tab-underline-color;
color: $text-secondary;
Expand Down
53 changes: 24 additions & 29 deletions packages/styles/scss/components/card-group/_card-group.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright IBM Corp. 2016, 2022
* Copyright IBM Corp. 2016, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand All @@ -23,7 +23,23 @@

@mixin card-group {
:host(#{$c4d-prefix}-card-group) {
--#{$c4d-prefix}--card-group--cards-in-row: 1;

display: grid;
grid-template-columns: 1fr;
gap: 1px;
background: none;

@include breakpoint(md) {
grid-template-columns: repeat(2, 1fr);
}

@include breakpoint(lg) {
grid-template-columns: repeat(
var(--#{$c4d-prefix}--card-group--cards-in-row),
1fr
);
}
}

:host(#{$c4d-prefix}-card-group[with-card-in-card][grid-mode]) {
Expand All @@ -32,20 +48,19 @@
padding-right: 1px;
}

:host(#{$c4d-prefix}-card-group[with-card-in-card][grid-mode="default"]) {
:host(#{$c4d-prefix}-card-group[with-card-in-card][grid-mode='default']) {
padding-top: $spacing-07;
}

:host(#{$c4d-prefix}-card-group[with-card-in-card][grid-mode="narrow"]) {
:host(#{$c4d-prefix}-card-group[with-card-in-card][grid-mode='narrow']) {
padding-top: $spacing-05;
}
}

:host(#{$c4d-prefix}-card-group-item) {

.#{$prefix}--card {
border: 0;
outline: 1px solid $border-tile-01;
outline-offset: 0px;
outline-offset: 0;
}

.#{$prefix}--image {
Expand All @@ -72,7 +87,7 @@
}
}

:host(#{$c4d-prefix}-card-group-item[href=""]) {
:host(#{$c4d-prefix}-card-group-item[href='']) {
.#{$prefix}--card {
outline: none;
}
Expand All @@ -83,7 +98,6 @@
}

:host(#{$c4d-prefix}-card-group-item[link]) {

::slotted(#{$c4d-prefix}-card-heading) {
@include type-style('heading-02');

Expand All @@ -93,25 +107,6 @@
.#{$prefix}--card .#{$prefix}--card__copy {
margin-top: 0;
}
}

:host(#{$c4d-prefix}-card-group) {
--#{$c4d-prefix}--card-group--cards-in-row: 1;

display: grid;
grid-template-columns: 1fr;
gap: 1px;

@include breakpoint(md) {
grid-template-columns: repeat(2, 1fr);
}

@include breakpoint(lg) {
grid-template-columns: repeat(
var(--#{$c4d-prefix}--card-group--cards-in-row),
1fr
);
}
}

:host(#{$c4d-prefix}-card-group)[grid-mode='narrow'] {
Expand All @@ -136,7 +131,7 @@
padding-top: $spacing-05;
gap: $spacing-07;
}
}
}

:host(#{$c4d-prefix}-card-group)[grid-mode='condensed'] {
@include breakpoint(sm) {
Expand All @@ -147,7 +142,7 @@
@include breakpoint(md) {
padding-top: $spacing-05;
}
}
}

// card with video focus outline
:host(#{$c4d-prefix}-card-group-item)[cta-type='video'] {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright IBM Corp. 2016, 2022
* Copyright IBM Corp. 2016, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -163,7 +163,6 @@
:host(#{$c4d-prefix}-card-in-card)[grid-mode='default'],
.#{$prefix}--card-in-card--narrow {
.#{$prefix}--card__wrapper {

@include breakpoint(md) {
width: calc(50% - #{$spacing-05} + #{rem(1px)});
}
Expand Down
9 changes: 0 additions & 9 deletions packages/styles/scss/components/card/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,7 @@
:host(#{$c4d-prefix}-content-group-cards-item),
:host(#{$c4d-prefix}-content-group-cards-item) .#{$prefix}--card {
@include tile($enable-experimental-tile-contrast: true);
}

:host(#{$c4d-prefix}-card),
:host(#{$c4d-prefix}-region-item) .#{$prefix}--link,
:host(#{$c4d-prefix}-card-group-item),
:host(#{$c4d-prefix}-card-group-item) .#{$prefix}--card,
:host(#{$c4d-prefix}-card-cta),
:host(#{$c4d-prefix}-card-in-card),
:host(#{$c4d-prefix}-content-group-cards-item),
:host(#{$c4d-prefix}-content-group-cards-item) .#{$prefix}--card {
position: relative;
display: flex;
flex-direction: column;
Expand Down
Loading

0 comments on commit 6caf5e7

Please sign in to comment.