Skip to content

Commit

Permalink
chore(styles): remove v10 deprecated styles for v11 (#11045)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
tay1orjones and kodiakhq[bot] authored Mar 27, 2022
1 parent 008a7df commit 779f223
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 157 deletions.
56 changes: 28 additions & 28 deletions docs/migration/v11.md
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ exports have changed or removed.

| v10 | v11 |
| :------------------------------ | :-------------------------------------- |
| `$base-font-size` | TODO |
| `$base-font-size` | Moved to `scss/utilities/_convert.scss` |
| `@function rem` | Moved to `scss/utilities/_convert.scss` |
| `@function em` | Moved to `scss/utilities/_convert.scss` |
| `@mixin type-style` | No changes |
Expand Down Expand Up @@ -1795,33 +1795,33 @@ were importing `@carbon/type/scss/styles` in v10 you would now only import

**Sass API**

| Filename | v10 | v11 |
| ------------------------------------- | ------------------------------------ | ------------------------------------ |
| `scss/index.scss` | | Removed, use `@carbon/type` directly |
| `scss/type.scss` | | Removed, use `@carbon/type` directly |
| `scss/_classes.scss` | `@mixin carbon--type-classes` | Renamed to `@mixin type-classes` |
| `scss/font-face/_mono.scss` | `@mixin carbon--font-face-mono` | TODO |
| `scss/font-face/_sans-condensed.scss` | `@mixin carbon--font-face-condensed` | TODO |
| `scss/font-face/_sans.scss` | `@mixin carbon--font-face-sans` | TODO |
| `scss/font-face/_serif.scss` | `@mixin carbon--font-face-serif` | TODO |
| `scss/font-face/_settings.scss` | `$carbon--font-display` | TODO |
| `scss/_font-family.scss` | `$carbon--font-families` | Renamed to `$font-families` |
| | `@function carbon--font-family` | Renamed to `@function font-family` |
| | `@mixin carbon--font-family` | Renamed to `@mixin font-family` |
| | `$carbon--font-weights` | Renamed to `$font-weights` |
| | `@function carbon--font-weight` | Renamed to `@function font-weight` |
| | `@mixin carbon--font-weight` | Renamed to `@mixin font-weight` |
| `scss/_prefix.scss` | | No Changes |
| `scss/_reset.scss` | `@mixin carbon--default-type` | Renamed to `@mixin default-type` |
| | `@mixin carbon--type-reset` | Renamed to `@mixin type-reset` |
| `scss/_scale.scss` | `@function carbon--get-type-size` | Removed, use `type-scale` instead |
| | `$carbon--type-scale` | Renamed to `$type-scale` |
| | `@function carbon--type-scale` | Renamed to `@function type-scale` |
| | `@mixin carbon--type-scale` | Renamed to `@mixin type-scale` |
| | `@mixin carbon--font-size` | Renamed to `@mixin font-size` |
| `scss/_styles.scss` | `@mixin carbon--type-style` | Renamed to `@mixin type-style` |
| `scss/_styles.scss` | `$caption-01` | Removed |
| | `$caption-02` | Removed |
| Filename | v10 | v11 |
| ------------------------------------- | ------------------------------------ | ----------------------------------------------------------------------------- |
| `scss/index.scss` | | Removed, use `@carbon/type` directly |
| `scss/type.scss` | | Removed, use `@carbon/type` directly |
| `scss/_classes.scss` | `@mixin carbon--type-classes` | Renamed to `@mixin type-classes` |
| `scss/font-face/_mono.scss` | `@mixin carbon--font-face-mono` | TODO |
| `scss/font-face/_sans-condensed.scss` | `@mixin carbon--font-face-condensed` | TODO |
| `scss/font-face/_sans.scss` | `@mixin carbon--font-face-sans` | TODO |
| `scss/font-face/_serif.scss` | `@mixin carbon--font-face-serif` | TODO |
| `scss/font-face/_settings.scss` | `$carbon--font-display` | TODO |
| `scss/_font-family.scss` | `$carbon--font-families` | Renamed to `$font-families` |
| | `@function carbon--font-family` | Renamed to `@function font-family` |
| | `@mixin carbon--font-family` | Renamed to `@mixin font-family` |
| | `$carbon--font-weights` | Renamed to `$font-weights` |
| | `@function carbon--font-weight` | Renamed to `@function font-weight` |
| | `@mixin carbon--font-weight` | Renamed to `@mixin font-weight` |
| `scss/_prefix.scss` | | No Changes |
| `scss/_reset.scss` | `@mixin carbon--default-type` | Renamed to `@mixin default-type` |
| | `@mixin carbon--type-reset` | Renamed to `@mixin reset`, no longer accepts `$base-font-size` as a parameter |
| `scss/_scale.scss` | `@function carbon--get-type-size` | Removed, use `type-scale` instead |
| | `$carbon--type-scale` | Renamed to `$type-scale` |
| | `@function carbon--type-scale` | Renamed to `@function type-scale` |
| | `@mixin carbon--type-scale` | Renamed to `@mixin type-scale` |
| | `@mixin carbon--font-size` | Renamed to `@mixin font-size` |
| `scss/_styles.scss` | `@mixin carbon--type-style` | Renamed to `@mixin type-style` |
| `scss/_styles.scss` | `$caption-01` | Removed |
| | `$caption-02` | Removed |

## Type tokens

Expand Down
20 changes: 0 additions & 20 deletions packages/grid/scss/_mixins.import.scss
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,6 @@
.#{$prefix}--row.#{$prefix}--no-gutter--end [class*='#{$prefix}--col'] {
padding-right: 0;
}

// Deprecated ☠️
.#{$prefix}--no-gutter--left,
.#{$prefix}--row.#{$prefix}--no-gutter--left [class*='#{$prefix}--col'] {
padding-left: 0;
}

.#{$prefix}--no-gutter--right,
.#{$prefix}--row.#{$prefix}--no-gutter--right [class*='#{$prefix}--col'] {
padding-right: 0;
}
}

// -----------------------------------------------------------------------------
Expand All @@ -242,15 +231,6 @@
.#{$prefix}--hang--end {
padding-right: $gutter * 0.5;
}

// Deprecated ☠️
.#{$prefix}--hang--left {
padding-left: $gutter * 0.5;
}

.#{$prefix}--hang--right {
padding-right: $gutter * 0.5;
}
}

// -----------------------------------------------------------------------------
Expand Down
20 changes: 0 additions & 20 deletions packages/grid/scss/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,6 @@
.#{$prefix}--row.#{$prefix}--no-gutter--end [class*='#{$prefix}--col'] {
padding-right: 0;
}

// Deprecated ☠️
.#{$prefix}--no-gutter--left,
.#{$prefix}--row.#{$prefix}--no-gutter--left [class*='#{$prefix}--col'] {
padding-left: 0;
}

.#{$prefix}--no-gutter--right,
.#{$prefix}--row.#{$prefix}--no-gutter--right [class*='#{$prefix}--col'] {
padding-right: 0;
}
}

// -----------------------------------------------------------------------------
Expand All @@ -230,15 +219,6 @@
.#{$prefix}--hang--end {
padding-right: ($gutter / 2);
}

// Deprecated ☠️
.#{$prefix}--hang--left {
padding-left: ($gutter / 2);
}

.#{$prefix}--hang--right {
padding-right: ($gutter / 2);
}
}

// -----------------------------------------------------------------------------
Expand Down
20 changes: 0 additions & 20 deletions packages/grid/scss/modules/_flex-grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,6 @@
.#{$prefix}--row.#{$prefix}--no-gutter--end [class*='#{$prefix}--col'] {
padding-right: 0;
}

// Deprecated ☠️
.#{$prefix}--no-gutter--left,
.#{$prefix}--row.#{$prefix}--no-gutter--left [class*='#{$prefix}--col'] {
padding-left: 0;
}

.#{$prefix}--no-gutter--right,
.#{$prefix}--row.#{$prefix}--no-gutter--right [class*='#{$prefix}--col'] {
padding-right: 0;
}
}

// -----------------------------------------------------------------------------
Expand All @@ -231,15 +220,6 @@
.#{$prefix}--hang--end {
padding-right: $gutter * 0.5;
}

// Deprecated ☠️
.#{$prefix}--hang--left {
padding-left: $gutter * 0.5;
}

.#{$prefix}--hang--right {
padding-right: $gutter * 0.5;
}
}

// -----------------------------------------------------------------------------
Expand Down
20 changes: 0 additions & 20 deletions packages/grid/scss/modules/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,6 @@
.#{$prefix}--row.#{$prefix}--no-gutter--end [class*='#{$prefix}--col'] {
padding-right: 0;
}

// Deprecated ☠️
.#{$prefix}--no-gutter--left,
.#{$prefix}--row.#{$prefix}--no-gutter--left [class*='#{$prefix}--col'] {
padding-left: 0;
}

.#{$prefix}--no-gutter--right,
.#{$prefix}--row.#{$prefix}--no-gutter--right [class*='#{$prefix}--col'] {
padding-right: 0;
}
}

// -----------------------------------------------------------------------------
Expand All @@ -225,15 +214,6 @@
.#{$prefix}--hang--end {
padding-right: ($gutter * 0.5);
}

// Deprecated ☠️
.#{$prefix}--hang--left {
padding-left: ($gutter * 0.5);
}

.#{$prefix}--hang--right {
padding-right: ($gutter * 0.5);
}
}

// -----------------------------------------------------------------------------
Expand Down
6 changes: 2 additions & 4 deletions packages/layout/scss/_convert.import.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ $carbon--base-font-size: 16px !default;
/// @group @carbon/layout
@function carbon--rem($px) {
@if unit($px) != 'px' {
// TODO: update to @error in v11
@warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
@error "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
}

@if meta.function-exists('div', 'math') {
Expand All @@ -53,8 +52,7 @@ $carbon--base-font-size: 16px !default;
/// @group @carbon/layout
@function carbon--em($px) {
@if unit($px) != 'px' {
// TODO: update to @error in v11
@warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
@error "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
}

@if meta.function-exists('div', 'math') {
Expand Down
6 changes: 2 additions & 4 deletions packages/layout/scss/_convert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ $carbon--base-font-size: 16px !default;
/// @group @carbon/layout
@function carbon--rem($px) {
@if unit($px) != 'px' {
// TODO: update to @error in v11
@warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
@error "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
}

@return ($px / $carbon--base-font-size) * 1rem;
Expand All @@ -46,8 +45,7 @@ $carbon--base-font-size: 16px !default;
/// @group @carbon/layout
@function carbon--em($px) {
@if unit($px) != 'px' {
// TODO: update to @error in v11
@warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
@error "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
}

@return ($px / $carbon--base-font-size) * 1em;
Expand Down
6 changes: 2 additions & 4 deletions packages/layout/scss/modules/_convert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ $base-font-size: 16px !default;
/// @group @carbon/layout
@function rem($px) {
@if unit($px) != 'px' {
// TODO: update to @error in v11
@warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
@error "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
}

@if meta.function-exists('div', 'math') {
Expand All @@ -39,8 +38,7 @@ $base-font-size: 16px !default;
/// @group @carbon/layout
@function em($px) {
@if unit($px) != 'px' {
// TODO: update to @error in v11
@warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
@error "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
}

@if meta.function-exists('div', 'math') {
Expand Down
4 changes: 0 additions & 4 deletions packages/styles/scss/components/button/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,6 @@
color: $text-on-color;
}

// TODO: deprecate single dash tertiary
&-tertiary,
&--tertiary {
@include button-theme(
transparent,
Expand Down Expand Up @@ -259,8 +257,6 @@
}
}

// TODO: deprecate single dash ghost
&-ghost,
&--ghost {
@include button-theme(
transparent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
height: rem(32px);
}

// TODO V11: Remove xl selector
.#{$prefix}--content-switcher--xl,
.#{$prefix}--content-switcher--lg {
height: rem(48px);
}
Expand Down
1 change: 0 additions & 1 deletion packages/styles/scss/components/dropdown/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@
transition: max-height $duration-fast-02 motion(entrance, productive);
}

// V11: Possibly deprecate
.#{$prefix}--dropdown--light {
background-color: $field;

Expand Down
29 changes: 7 additions & 22 deletions packages/styles/scss/components/text-input/_text-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
}
}

// TODO V11: Remove xl selector
.#{$prefix}--text-input--xl,
.#{$prefix}--text-input--lg {
height: rem(48px);
}
Expand Down Expand Up @@ -124,8 +122,6 @@
@include tooltip--placement('icon', 'bottom', 'center');
}

.#{$prefix}--text-input--password__visibility,
// TODO: remove selector above
.#{$prefix}--btn.#{$prefix}--text-input--password__visibility__toggle.#{$prefix}--tooltip__trigger {
@include focus-outline('reset');

Expand Down Expand Up @@ -188,11 +184,8 @@
padding-right: rem(64px);
}

.#{$prefix}--text-input--invalid +
.#{$prefix}--text-input--password__visibility,
// TODO: remove selector above
.#{$prefix}--text-input--invalid +
.#{$prefix}--text-input--password__visibility__toggle {
.#{$prefix}--text-input--invalid
+ .#{$prefix}--text-input--password__visibility__toggle {
right: $spacing-05;
}

Expand All @@ -201,11 +194,8 @@
}

.#{$prefix}--text-input:disabled
+ .#{$prefix}--text-input--password__visibility
svg,
// TODO: remove selector above
.#{$prefix}--text-input:disabled
+ .#{$prefix}--text-input--password__visibility__toggle.#{$prefix}--tooltip__trigger svg {
+ .#{$prefix}--text-input--password__visibility__toggle.#{$prefix}--tooltip__trigger
svg {
cursor: not-allowed;
fill: $icon-disabled;

Expand Down Expand Up @@ -246,8 +236,6 @@

box-shadow: none;

.#{$prefix}--text-input--password__visibility,
// TODO: remove selector above
.#{$prefix}--text-input--password__visibility__toggle {
right: $spacing-08;
}
Expand Down Expand Up @@ -355,8 +343,6 @@
margin-top: rem(9px);
}

// TODO V11: Remove xl selector
.#{$prefix}--text-input-wrapper .#{$prefix}--label--inline--xl,
.#{$prefix}--text-input-wrapper .#{$prefix}--label--inline--lg {
margin-top: rem(17px);
}
Expand Down Expand Up @@ -396,10 +382,9 @@
}

// Windows HCM fix
.#{$prefix}--text-input--password__visibility,
// TODO: remove selector above
.#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--text-input--password__visibility__toggle.#{$prefix}--tooltip__trigger svg,
.#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--text-input--password__visibility__toggle.#{$prefix}--tooltip__trigger:hover
.#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--text-input--password__visibility__toggle.#{$prefix}--tooltip__trigger
svg,
.#{$prefix}--btn.#{$prefix}--btn--icon-only.#{$prefix}--text-input--password__visibility__toggle.#{$prefix}--tooltip__trigger:hover
svg {
@include high-contrast-mode('icon-fill');
}
Expand Down
6 changes: 2 additions & 4 deletions packages/styles/scss/utilities/_convert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ $base-font-size: 16px !default;
/// @group utilities
@function rem($px) {
@if unit($px) != 'px' {
// TODO: update to @error in v11
@warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
@error "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
}

@if meta.function-exists('div', 'math') {
Expand All @@ -38,8 +37,7 @@ $base-font-size: 16px !default;
/// @group utilities
@function em($px) {
@if unit($px) != 'px' {
// TODO: update to @error in v11
@warn "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
@error "Expected argument $px to be of type `px`, instead received: `#{unit($px)}`";
}

@if meta.function-exists('div', 'math') {
Expand Down
Loading

0 comments on commit 779f223

Please sign in to comment.