From 58eb28608582fabfc5db3688510107dec99e5ec7 Mon Sep 17 00:00:00 2001 From: kennylam <909118+kennylam@users.noreply.github.com> Date: Thu, 5 Oct 2023 15:24:18 -0400 Subject: [PATCH 1/2] feat(link-with-icon): upgrade to v2 styles --- .../link-with-icon/_link-with-icon.scss | 12 +++---- .../link-with-icon/link-with-icon.scss | 36 ------------------- 2 files changed, 6 insertions(+), 42 deletions(-) diff --git a/packages/styles/scss/components/link-with-icon/_link-with-icon.scss b/packages/styles/scss/components/link-with-icon/_link-with-icon.scss index 40d03a0ca7b..01f94c8539d 100644 --- a/packages/styles/scss/components/link-with-icon/_link-with-icon.scss +++ b/packages/styles/scss/components/link-with-icon/_link-with-icon.scss @@ -20,12 +20,8 @@ :host(#{$c4d-prefix}-link-list-item), :host(#{$c4d-prefix}-link-list-item-cta), :host(#{$c4d-prefix}-text-cta) { - display: flex; - span { vertical-align: middle; - align-self: center; - flex: 1; } svg, @@ -46,6 +42,11 @@ } } + // Re-define the ruleset so this wins over `.cds--link:visited`, etc. + .#{$prefix}--link--disabled { + color: $text-disabled; + } + &.#{$prefix}--link-with-icon__icon-left, .#{$prefix}--link-with-icon.#{$prefix}--link-with-icon--inline-icon.#{$prefix}--link-with-icon__icon-left { display: flex; @@ -78,8 +79,7 @@ text-underline-position: under; } - svg, - ::slotted(svg[slot='icon']) { + svg { display: inline; vertical-align: middle; white-space: nowrap; diff --git a/packages/web-components/src/components/link-with-icon/link-with-icon.scss b/packages/web-components/src/components/link-with-icon/link-with-icon.scss index 4a4a901340c..eec1e966da5 100644 --- a/packages/web-components/src/components/link-with-icon/link-with-icon.scss +++ b/packages/web-components/src/components/link-with-icon/link-with-icon.scss @@ -5,40 +5,4 @@ // LICENSE file in the root directory of this source tree. // -@use '@carbon/styles/scss/breakpoint' as *; -@use '@carbon/styles/scss/config' as *; -@use '@carbon/styles/scss/spacing' as *; -@use '@carbon/styles/scss/theme' as *; @use '@carbon/ibmdotcom-styles/scss/components/link-with-icon'; -@use '@carbon/ibmdotcom-styles/scss/globals/vars' as *; - -:host(#{$c4d-prefix}-link-with-icon), -:host(#{$c4d-prefix}-link-list-item), -:host(#{$c4d-prefix}-text-cta), -:host(#{$c4d-prefix}-link-list-item-cta) { - // Re-define the ruleset so this wins over `.cds--link:visited`, etc. - .#{$prefix}--link--disabled { - color: $text-disabled; - } -} - -:host(#{$c4d-prefix}-link-list-item) { - .#{$prefix}--link { - align-content: flex-start; - - span, - ::slotted(svg[slot='icon']) { - align-self: flex-start; - } - } -} - -:host(#{$c4d-prefix}-link-list-item)[type='end'] { - .#{$prefix}--link-with-icon__icon-left ::slotted(svg[slot='icon']) { - margin-right: $spacing-07; - } - - .#{$prefix}--link-with-icon__icon-right ::slotted(svg[slot='icon']) { - margin-left: $spacing-07; - } -} From bf3d0f0128634784bf8ce0f464407d92c302f6ce Mon Sep 17 00:00:00 2001 From: kennylam <909118+kennylam@users.noreply.github.com> Date: Thu, 5 Oct 2023 18:29:49 -0400 Subject: [PATCH 2/2] chore(docs): update migration docs --- docs/dotcom-v2-migration.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/dotcom-v2-migration.md b/docs/dotcom-v2-migration.md index 70064791175..05d194c799a 100644 --- a/docs/dotcom-v2-migration.md +++ b/docs/dotcom-v2-migration.md @@ -50,6 +50,7 @@ For Carbon v11 migration guidance, see their | image-with-caption | This component is deprecated in v1 and has been removed in v2 in favor of the image component | | leadspace | View changes [here](#leadspace) | | link-list-section | This component is deprecated in v2 in favor for content-section/block & link-list end of section variant components | +| link-with-icon | No API changes. | | logo-grid | This component is deprecated in v2 in favor for content-section/block & image-group components | | pictogram-item | This component is deprecated in v2 in favor for content-item (pictogram variation) componet | | quote | No API changes. |