Skip to content

Commit

Permalink
fix: margins and disabled on next
Browse files Browse the repository at this point in the history
  • Loading branch information
dauriamarco committed Apr 24, 2024
1 parent 1e89e14 commit d3f198b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
14 changes: 4 additions & 10 deletions src/components/stepper/stepper/stepper.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
flex-direction: var(--sbb-stepper-orientation);
position: relative;
justify-content: space-between;
margin-block-end: var(--sbb-spacing-responsive-m);
margin-block-end: var(--sbb-spacing-fixed-8x);

&::before {
content: '';
Expand Down Expand Up @@ -97,7 +97,7 @@

content: counter(step-label);
counter-increment: step-label;
cursor: pointer;
cursor: var(--sbb-step-label-cursor);
color: var(--sbb-step-label-color);
inset-block-start: calc(
var(--sbb-font-size-text-l) * (var(--sbb-typo-line-height-body-text) / 2) +
Expand All @@ -124,18 +124,12 @@
@include sbb.text-xxs--bold;

:host([orientation='vertical']) & {
margin-block-end: var(--sbb-spacing-responsive-m);
margin-block-end: var(--sbb-spacing-fixed-8x);
}
}

::slotted(sbb-step-label:not(:first-child)) {
:host([orientation='vertical']) & {
margin-block-start: var(--sbb-spacing-responsive-m);
}
}

::slotted(sbb-step[data-selected]:not(:last-child)) {
:host([orientation='vertical']) & {
margin-block-end: var(--sbb-spacing-fixed-8x);
margin-block-start: var(--sbb-spacing-fixed-6x);
}
}
4 changes: 2 additions & 2 deletions src/components/stepper/stepper/stepper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export class SbbStepperElement extends LitElement {
private _resizeObserverTimeout: ReturnType<typeof setTimeout> | null = null;

private _isValidStep(step: SbbStepElement): boolean {
if (!step || step === this.selected || step.hasAttribute('disabled')) {
if (!step || step === this.selected || step.label?.hasAttribute('disabled')) {
return false;
}

Expand Down Expand Up @@ -190,7 +190,7 @@ export class SbbStepperElement extends LitElement {
return (
offset +
this.selected!.label!.offsetHeight! +
parseFloat(getComputedStyle(this).getPropertyValue('--sbb-spacing-responsive-m')) *
parseFloat(getComputedStyle(this).getPropertyValue('--sbb-spacing-fixed-6x')) *
16 *
this.selectedIndex
);
Expand Down

0 comments on commit d3f198b

Please sign in to comment.