Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(styles): remove deprecated line height variables #3521

Merged
merged 6 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/sharp-crews-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@swisspost/design-system-styles': major
'@swisspost/design-system-documentation': minor
---

Removed deprecated line-height variables.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import './migrationv4-5.component';
import './migrationv5-6.component';
import './migrationv6-7.component';
import './migrationv7-8.component';
import './migrationv8-9.component';

<Meta of={MigrationGuideStories} />

Expand All @@ -25,4 +26,6 @@ import './migrationv7-8.component';

<migration-version-7-8></migration-version-7-8>

<migration-version-8-9></migration-version-8-9>

</migration-global-state>
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { html, LitElement, nothing } from 'lit';
import { _templateAutoIcon } from '@/stories/getting-started/migration-guide/util/template.util';
import { customElement, property } from 'lit/decorators.js';

@customElement('migration-version-8-9')
export class MigrationV89Component extends LitElement {
@property({ type: Number }) currentVersion?: number;
@property({ type: String }) environment?: string;
@property({ type: Boolean }) angular?: boolean;

createRenderRoot() {
/**
* Render template without shadow DOM.
*/
return this;
}

render() {
if (!this.currentVersion || this.currentVersion > 8) return nothing;

return html`
<h2 id="migration-from-v8-to-v9" class="docs-autolink">
Migration from v8 to v9
<a
aria-hidden="true"
tabindex="-1"
href="http://localhost:9000/?path=/docs/c23b1d0b-76b3-4e38-aa76-b10c29bb873f--docs#migration-from-v8-to-v9"
>
<post-icon name="2037"></post-icon>
</a>
</h2>
<section>
<ol class="bubble-tea">
<li>
<h3>Component Migration 🤓</h3>

<section>
<h4>Styles</h4>

<ul>
<li class="mb-3">
<p>
Removed deprecated line-height variables
<span class="tag tag-sm tag-danger">breaking</span>
</p>
<ul>
<li><code>$line-heights</code></li>
<li><code>$line-height-tiny</code></li>
<li><code>$line-height-small</code></li>
<li><code>$line-height-regular</code></li>
<li><code>$line-height-bigger-regular</code></li>
<li><code>$line-height-medium</code></li>
<li><code>$line-height-large</code></li>
<li><code>$line-height-small-big</code></li>
<li><code>$line-height-big</code></li>
<li><code>$line-height-bigger-big</code></li>
<li><code>$line-height-small-huge</code></li>
<li><code>$line-height-huge</code></li>
alizedebray marked this conversation as resolved.
Show resolved Hide resolved
</ul>
</li>
</ul>
</section>
</li>
</ol>
</section>
`;
}

private _templateAutoIconAngular() {
return html` ${this.angular ? _templateAutoIcon() : nothing} `;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ export class SetupComponent extends LitElement {
id="docs_Default_ExampleSelect"
class="form-select form-select-lg"
>
<option value="8" ?selected="${this.currentVersion === 8}">
@swisspost/design-system-styles 8.x.x
</option>
<option value="7" ?selected="${this.currentVersion === 7}">
@swisspost/design-system-styles 7.x.x
</option>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@use '@swisspost/design-system-styles/core' as post;

.my-element {
line-height: post.$line-height-tiny;
line-height: post.$line-height-sm;
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ import SampleColor from './text-color.sample.scss?raw';

### Line Heights

<div className="alert alert-warning my-4">
Fixed-size line heights are deprecated in favor of relative line height utility classes.
</div>

<Canvas of={TextStories.LineHeight} sourceState="shown" />

#### Set Line Height in SCSS
Expand Down
27 changes: 0 additions & 27 deletions packages/styles/src/variables/_type.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,6 @@ $line-height-sm: 1;
$line-height-copy: 1.5;
$line-height-heading: 1.2;

// Deprecated
$line-height-tiny: $line-height-copy;
$line-height-small: $line-height-copy;
$line-height-regular: $line-height-copy;
$line-height-bigger-regular: $line-height-copy;
$line-height-medium: $line-height-copy;
$line-height-large: $line-height-heading;
$line-height-small-big: $line-height-heading;
$line-height-big: $line-height-heading;
$line-height-bigger-big: $line-height-heading;
$line-height-small-huge: $line-height-heading;
$line-height-huge: $line-height-heading;

$font-weight-light: 300 !default; // Design System -> Frutiger Neue Light
$font-weight-normal: 400 !default; // Design System -> Frutiger Neue Roman
$font-weight-bold: 700 !default; // Design System -> Frutiger Neue Bold
Expand Down Expand Up @@ -99,20 +86,6 @@ $font-size-map: (
56: $font-size-56,
);

$line-heights: (
'tiny': $line-height-tiny,
'small': $line-height-small,
'regular': $line-height-regular,
'bigger-regular': $line-height-bigger-regular,
'medium': $line-height-medium,
'large': $line-height-large,
'small-big': $line-height-small-big,
'big': $line-height-big,
'bigger-big': $line-height-bigger-big,
'small-huge': $line-height-small-huge,
'huge': $line-height-huge,
);

// Deprecated
$font-curve-tiny: (
'xs': $font-size-tiny,
Expand Down