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

chore(styles): remove deprecated text placeholders #3623

Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions .changeset/kind-papayas-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@swisspost/design-system-styles': major
---

The following placeholders from the `\_text.scss` file are deprecated and have been removed: `%list-adjustment`, `%module-container`, `%default-module-spacer`, `%text-container`, as well as the class: `.text-container`.
leagrdv marked this conversation as resolved.
Show resolved Hide resolved
141 changes: 0 additions & 141 deletions packages/styles/src/placeholders/_text.scss
Original file line number Diff line number Diff line change
@@ -1,38 +1,7 @@
@use 'sass:map';
@use './../themes/bootstrap/core' as *;
@use './../variables/spacing';
@use './../variables/type';
@use './../variables/color';
@use './../mixins/size' as size-mx;
@use './../mixins/type' as type-mx;
@use './../variables/components/paragraph';

%list-adjustment {
ul {
position: relative;
margin-top: paragraph.$text-bottom-space;
margin-bottom: paragraph.$text-bottom-space;
padding-left: map.get(spacing.$post-sizes, 'big');
list-style: none;
text-align: left;

li {
margin-bottom: paragraph.$text-bottom-space * 0.5;

&::before {
content: '\2013';
display: inline-block;
position: absolute;
left: 0;
}

&:last-child {
margin-bottom: 0;
}
}
}
}

@each $key, $value in type.$font-curves {
%font-curve-#{$key} {
@include type-mx.font-curve($key);
Expand All @@ -43,113 +12,3 @@
margin-bottom: paragraph.$text-bottom-space; // 0.8 times the size of the current font (20px) = 16px
}

// Removes margin-top from first and margin-bottom from last child
%module-container {
> :first-child {
margin-top: 0;
}

> :last-child {
margin-bottom: 0;
}
}

%default-module-spacer {
margin-top: map.get(spacing.$post-sizes, 'huge'); // 56px
margin-bottom: map.get(spacing.$post-sizes, 'huge'); // 56px

@include media-breakpoint-up(md) {
margin-top: map.get(spacing.$post-sizes, 'giant'); // 80px
margin-bottom: map.get(spacing.$post-sizes, 'giant'); // 80px
}
}

%text-container {
@extend %module-container;

ul {
position: relative;
margin-top: paragraph.$text-bottom-space;
margin-bottom: paragraph.$text-bottom-space;
padding-left: map.get(spacing.$post-sizes, 'big');
list-style: none;

li {
@extend %font-curve-regular;
@extend %text-bottom-spacer;

&::before {
content: '\2013';
display: inline-block;
position: absolute;
left: 0;
}

&:last-child {
margin-bottom: 0;
}
}

&.bulletpoints {
padding-left: map.get(spacing.$post-sizes, 'big');

@include media-breakpoint-up(md) {
padding-left: map.get(spacing.$post-sizes, 'bigger-big');
}

li {
position: relative;

// stylelint-disable-next-line max-nesting-depth
&::before {
content: '';
position: absolute;
top: 2px;
left: -(map.get(spacing.$post-sizes, 'big'));
width: map.get(spacing.$post-sizes, 'small-large');
height: map.get(spacing.$post-sizes, 'small-large');
border-radius: 50%;

@include media-breakpoint-up(md) {
left: -(map.get(spacing.$post-sizes, 'bigger-big'));
width: map.get(spacing.$post-sizes, 'large');
height: map.get(spacing.$post-sizes, 'large');
}
}
}
}
}

ol {
position: relative;
margin-top: paragraph.$text-bottom-space;
margin-bottom: paragraph.$text-bottom-space;
padding-left: map.get(spacing.$post-sizes, 'big');
list-style: none;
counter-reset: li-counter;

li {
counter-increment: li-counter;

&::before {
content: counter(li-counter) '.';
position: absolute;
left: 0;
}
}
}

.h-highlighted {
@extend %font-curve-regular;
@extend %text-bottom-spacer;
@include size-mx.bezel-regular;
background-color: rgba(map.get(color.$background-colors, 'nightblue-bright'), 0.1);

@include media-breakpoint-up(lg) {
@include size-mx.bezel-medium;
}
@include media-breakpoint-up(xxl) {
@include size-mx.bezel-large;
}
}
}
4 changes: 0 additions & 4 deletions packages/styles/tests/placeholders/index.test.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@
.toggler-icon {
@extend %toggler-icon;
}

.list-adjustment {
@extend %list-adjustment;
}
7 changes: 0 additions & 7 deletions packages/styles/tests/placeholders/text.test.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
@use 'src/placeholders/text';

.list-adjustment {
leagrdv marked this conversation as resolved.
Show resolved Hide resolved
@extend %list-adjustment;
@extend %module-container;
@extend %font-curve-tiny;
@extend %font-curve-small;
@extend %font-curve-regular;
Expand All @@ -11,9 +9,4 @@
@extend %font-curve-large;
@extend %font-curve-big;
@extend %text-bottom-spacer;
@extend %default-module-spacer;
}

.text-container {
@extend %text-container;
}
Loading