Skip to content

Commit

Permalink
refactor: remove obsolete host-component-properties mixin (#2574)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeripeierSBB authored Apr 15, 2024
1 parent 335cd7b commit f09cbaf
Show file tree
Hide file tree
Showing 96 changed files with 337 additions and 299 deletions.
4 changes: 2 additions & 2 deletions src/components/_index.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@forward 'core/styles' hide development-style, host-component-properties, link-base,
link-focus-visible, link-hover, link-active, link-consolidation;
@forward 'core/styles' hide development-style, link-base, link-focus-visible, link-hover,
link-active, link-consolidation;
9 changes: 6 additions & 3 deletions src/components/accordion/accordion.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@use '../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
display: block;
}
9 changes: 6 additions & 3 deletions src/components/action-group/action-group.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
@use '../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
display: block;
}

$breakpoints: 'zero', 'micro', 'small', 'medium', 'large', 'wide', 'ultra';
$vertical-orientations: (
Expand Down
7 changes: 4 additions & 3 deletions src/components/alert/alert-group/alert-group.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
@use '../../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
--sbb-alert-group-gap: var(--sbb-spacing-fixed-3x);
--sbb-alert-group-border-radius: var(--sbb-border-radius-4x);

display: block;
}

.sbb-alert-group {
Expand Down
7 changes: 4 additions & 3 deletions src/components/alert/alert/alert.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ $open-anim-rows-to: 1fr;
$open-anim-opacity-from: 0;
$open-anim-opacity-to: 1;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
--sbb-focus-outline-color: var(--sbb-focus-outline-color-dark);
Expand All @@ -31,6 +30,8 @@ $open-anim-opacity-to: 1;
outline: var(--sbb-border-width-1x) solid CanvasText;
border-radius: var(--sbb-alert-border-radius);
}

display: block;
}

:host([disable-animation]) {
Expand Down
7 changes: 4 additions & 3 deletions src/components/autocomplete/autocomplete.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@use '../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

// Fixes the gap between the origin and the overlay by creating conjunction
// corners based on the origin element border radius
Expand All @@ -15,6 +14,8 @@
--sbb-autocomplete-z-index,
var(--sbb-overlay-default-z-index)
);

display: block;
}

:host([negative]) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
@use '../../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
--sbb-breadcrumb-group-wrap: nowrap;
--sbb-breadcrumb-group-visibility: hidden;

display: block;
}

:host([data-loaded]) {
Expand Down
5 changes: 2 additions & 3 deletions src/components/breadcrumb/breadcrumb/breadcrumb.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@use '../../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
display: flex;
Expand Down
5 changes: 2 additions & 3 deletions src/components/button/common/button-common.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@use '../../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

$icon-only: ':where([data-slot-names~=icon], [icon-name]):not([data-slot-names~=unnamed])';

Expand Down
7 changes: 4 additions & 3 deletions src/components/button/mini-button/mini-button.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
@use '../../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
display: block;

// Use !important here to not interfere with Firefox focus ring definition
// which appears in normalize css of several frameworks.
outline: none !important;
Expand Down
7 changes: 4 additions & 3 deletions src/components/calendar/calendar.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@use '../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
--sbb-calendar-cell-size: #{sbb.px-to-rem-build(40)};
Expand Down Expand Up @@ -33,6 +32,8 @@
--sbb-calendar-control-view-change-height: #{sbb.px-to-rem-build(48)};
}

display: block;

// We add width definition to host, to make overwriting easy for consumers.
width: max-content;
}
Expand Down
7 changes: 4 additions & 3 deletions src/components/card/card-badge/card-badge.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
@use '../../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
--sbb-card-badge-gap: var(--sbb-spacing-fixed-2x);

display: block;
}

:host([color='white']) {
Expand Down
7 changes: 4 additions & 3 deletions src/components/card/card/card.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@use '../../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

// # Stacking of action
// To support content with actions that should be accessible, we have to stack the action and content like following:
Expand All @@ -11,6 +10,8 @@

:host {
@include sbb.card-variables;

display: block;
}

:host([color='milk']) {
Expand Down
7 changes: 4 additions & 3 deletions src/components/card/common/card-action.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
@use '../../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
display: block;

// Use !important here to not interfere with Firefox focus ring definition
// which appears in normalize css of several frameworks.
outline: none !important;
Expand Down
9 changes: 5 additions & 4 deletions src/components/checkbox/checkbox-group/checkbox-group.scss
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
@use '../../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;

@mixin horizontal-orientation {
--sbb-checkbox-group-orientation: row;
--sbb-checkbox-group-checkbox-width: auto;
}

$breakpoints: 'zero', 'micro', 'small', 'medium', 'large', 'wide', 'ultra';

// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
@include horizontal-orientation;

--sbb-checkbox-group-width: max-content;
--sbb-checkbox-group-gap: var(--sbb-spacing-fixed-3x) var(--sbb-spacing-fixed-6x);

display: block;
}

:host([orientation='vertical']) {
Expand Down
5 changes: 2 additions & 3 deletions src/components/checkbox/checkbox/checkbox.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@use '../../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
--sbb-checkbox-dimension: var(--sbb-size-icon-ui-small);
Expand Down
5 changes: 2 additions & 3 deletions src/components/chip/chip.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@use '../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
display: inline-block;
Expand Down
7 changes: 4 additions & 3 deletions src/components/clock/clock.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@use '../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
--sbb-clock-hours-animation-start-angle: 0deg;
Expand All @@ -11,6 +10,8 @@
--sbb-clock-seconds-animation-duration: 0s;
--sbb-clock-animation-play-state: paused;
--sbb-clock-seconds-hand-color: var(--sbb-color-red);

display: block;
}

.sbb-clock {
Expand Down
9 changes: 6 additions & 3 deletions src/components/container/container/container.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
@use '../../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
display: block;
}

:host([color='white']) {
--sbb-container-background-color: var(--sbb-color-white);
Expand Down
5 changes: 3 additions & 2 deletions src/components/container/sticky-bar/sticky-bar.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
@use '../../core/styles' as sbb;

// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

$intersector-overlapping: 1px;

:host {
@include sbb.box-sizing;

--sbb-sticky-bar-padding-block: var(--sbb-spacing-responsive-xs);
--sbb-sticky-bar-fade-in-animation-duration: var(--sbb-animation-duration-5x);
--sbb-sticky-bar-fade-out-animation-duration: var(--sbb-animation-duration-2x);
Expand Down
1 change: 0 additions & 1 deletion src/components/core/styles/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@
@forward './mixins/typo';

// Internals
@forward './core/component-utilities';
@forward './mixins/dev_and_debug';
22 changes: 0 additions & 22 deletions src/components/core/styles/core/component-utilities.scss

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@use '../../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@use '../../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
@use '../../core/styles' as sbb;

// Default component properties, defined for :host. Properties which can not
// travel the shadow boundary are defined through this mixin
@include sbb.host-component-properties;
// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
--sbb-datepicker-control-radius: var(--sbb-border-radius-4x);
Expand Down
3 changes: 3 additions & 0 deletions src/components/dialog/dialog-actions/dialog-actions.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@use '../../core/styles' as sbb;

// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
display: contents;

Expand Down
3 changes: 3 additions & 0 deletions src/components/dialog/dialog-content/dialog-content.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@use '../../core/styles' as sbb;

// Box-sizing rules contained in typography are not traversing Shadow DOM boundaries. We need to include box-sizing mixin in every component.
@include sbb.box-sizing;

:host {
display: contents;
}
Expand Down
Loading

0 comments on commit f09cbaf

Please sign in to comment.