Skip to content

Commit

Permalink
Merge pull request #999 from City-of-Helsinki/UHF-9736_article_featur…
Browse files Browse the repository at this point in the history
…e_fixes

UHF-9736: Article feature fixes
  • Loading branch information
teroelonen authored May 30, 2024
2 parents 7af3ada + bddba74 commit c466850
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 40 deletions.
2 changes: 1 addition & 1 deletion dist/css/styles.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/scss/05_objects/__index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
@import 'hyphenate';
@import 'link';
@import 'quote';
@import 'unpublished-content-flag';
@import 'user-edited-content';
@import 'main-image';
10 changes: 10 additions & 0 deletions src/scss/05_objects/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ $item-gap: $spacing-half;
@include font('body');
padding-left: $spacing-double; // icon-size + gap

[dir='rtl'] & {
padding-left: 0;
padding-right: $spacing-double; // icon-size + gap
}

& + & {
margin-top: $item-gap;
}
Expand All @@ -177,6 +182,11 @@ $item-gap: $spacing-half;
display: inline-block;
margin-left: - $spacing-double;
margin-right: $spacing-half;

[dir='rtl'] & {
margin-left: $spacing-half;
margin-right: - $spacing-double;
}
}

.card__meta__label {
Expand Down
10 changes: 10 additions & 0 deletions src/scss/05_objects/_link.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,14 @@ a:hover .link__type {
margin-inline-start: calc(var(--line-height) * -1em - $spacing-half);
transform: scaleX(var(--lang-direction, 1));
}

[dir='rtl'] & {
padding-left: 0;
padding-right: calc(var(--line-height) * 1em + $spacing-half);

&::before {
margin-left: $spacing-half;
margin-right: calc(var(--line-height) * -1em - $spacing-half);
}
}
}
29 changes: 29 additions & 0 deletions src/scss/05_objects/_unpublished-content-flag.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[data-unpublished]::before {
@include font('small');

--line-height: 1;
background: $color-error;
color: $color-white;
content: attr(data-unpublished);
display: block;
padding-left: $spacing-half;
padding-right: $spacing-half;
position: fixed;
transform: rotate(-90deg) translateX(calc(-50% - 50vh));
transform-origin: top left;
z-index: 2;

[dir='rtl'] & {
right: 27px;
transform: rotate(-90deg) translateX(calc(0% - 44vh));
transform-origin: top right;
}

@include breakpoint($component-side-padding-breakpoint) {
content: attr(data-unpublished-long);

@include font('body');

--line-height: 1.5;
}
}
24 changes: 0 additions & 24 deletions src/scss/06_components/pages/_basic-page.scss
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
[data-unpublished]::before {
@include font('small');

--line-height: 1;
background: $color-error;
color: $color-white;
content: attr(data-unpublished);
display: block;
padding-left: $spacing-half;
padding-right: $spacing-half;
position: fixed;
transform: rotate(-90deg) translateX(calc(-50% - 50vh));
transform-origin: top left;
z-index: 2;

@include breakpoint($component-side-padding-breakpoint) {
content: attr(data-unpublished-long);

@include font('body');

--line-height: 1.5;
}
}

.lead-in .component__content {
@include font('lead');
max-width: $content-width-max;
Expand Down
51 changes: 36 additions & 15 deletions src/scss/06_components/pages/_news-page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
padding-top: 0;
}

:not(.latest-news-list, .component--top-news .news-listing) > .news-listing__item {
:not(.component--latest-news .news-listing, .component--top-news .news-listing) > .news-listing__item {
list-style: none;
margin-top: $spacing-and-half;
padding-left: 0; // Remove card paddings from news listing
Expand Down Expand Up @@ -89,28 +89,24 @@

// Latest news block variant.
.news-listing--latest-medium-teasers {
margin-bottom: 0;
padding-inline-start: 0; // User agent stylesheet override
padding-right: 0;

@include breakpoint($breakpoint-m) {
display: flex;
flex-wrap: wrap;
grid-column-gap: $spacing-and-half;
grid-row-gap: $spacing-double;
display: grid;
grid-template-columns: repeat(2, 1fr);
}

.news-listing__item {
&:first-child {
margin-top: 0;
}

&:nth-child(2) {
@include breakpoint($breakpoint-m) {
margin-top: 0;
}
}
list-style: none;
margin-top: $spacing-and-half;
position: relative;

@include breakpoint($breakpoint-m) {
margin-top: $spacing-double;
padding-inline-end: $spacing-and-half;
width: 50%;
margin-top: 0;
}
}
}
Expand All @@ -133,6 +129,21 @@
width: $spacing-quarter;
}

[dir='rtl'] & {
padding-left: 0;
padding-right: $spacing + $spacing-quarter;

@include breakpoint($breakpoint-l) {
padding-left: 0;
padding-right: $spacing-and-half + $spacing-quarter;
}

&::before {
left: auto;
right: 0;
}
}

.news-listing__title {
@include font(h5);

Expand Down Expand Up @@ -285,6 +296,16 @@
padding: $spacing 0 0 0;
width: unset;
}

[dir='rtl'] & {
padding-left: 0;
padding-right: $spacing;

@include breakpoint($breakpoint-m) {
padding-left: 0;
padding-right: 0;
}
}
}

.news-listing__link {
Expand Down

0 comments on commit c466850

Please sign in to comment.