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

fix responsive spacings & font sizes #181

Merged
merged 2 commits into from
Jul 26, 2023
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
1 change: 1 addition & 0 deletions news/181.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed responsive spacings & font sizes for mobile screens. @danalvrz
5 changes: 2 additions & 3 deletions src/theme/_bgcolor-blocks-layout.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.blocks-group-wrapper {
padding-top: $color-block-change-vertical-spacing;
padding-bottom: $color-block-change-vertical-spacing;
@include color-block-change-vertical-spacing();
}

.blocks-group-wrapper.grey {
Expand All @@ -25,7 +24,7 @@
// For grids
#page-document .blocks-group-wrapper .block.gridBlock {
&.is--first--of--block-type.previous--has--same--backgroundColor {
margin-top: $grid-block-vertical-spacing-top;
@include grid-block-vertical-spacing-top();
}
&.is--last--of--block-type.next--has--same--backgroundColor {
margin-bottom: $grid-block-vertical-spacing-bottom;
Expand Down
4 changes: 4 additions & 0 deletions src/theme/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,9 @@
margin-bottom: $spacing-medium;
color: $black;
@include body-text();

@media only screen and (max-width: $largest-mobile-screen) {
margin-bottom: $spacing-large;
}
}
}
48 changes: 43 additions & 5 deletions src/theme/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,27 @@ $horizontal-space-small-screens: $spacing-small !default;
// Vertical Spacing
$block-vertical-space: 25px !default;

// Change of color
$color-block-change-vertical-spacing: 80px !default;

// Grids
$grid-block-vertical-spacing-top: 80px !default;
$grid-block-vertical-spacing-bottom: 80px !default;

@mixin vertical-space-h1() {
margin-top: 40px;
margin-bottom: 80px;
@media only screen and (max-width: $largest-mobile-screen) {
margin-bottom: 60px;
}
}

@mixin vertical-space-h2() {
margin-top: 80px;
margin-bottom: 40px;
@media only screen and (max-width: $largest-mobile-screen) {
margin-top: 60px;
}
}

@mixin vertical-space-h3() {
Expand All @@ -108,11 +121,19 @@ $block-vertical-space: 25px !default;
@mixin vertical-space-heading() {
margin-top: 80px;
margin-bottom: 80px;
@media only screen and (max-width: $largest-mobile-screen) {
margin-top: 60px;
margin-bottom: 60px;
}
}

@mixin vertical-space-introduction() {
margin-top: 80px;
margin-bottom: 80px;
@media only screen and (max-width: $largest-mobile-screen) {
margin-top: 60px;
margin-bottom: 60px;
}
}

@mixin vertical-space-button() {
Expand All @@ -127,19 +148,36 @@ $block-vertical-space: 25px !default;
@mixin vertical-space-separator() {
margin-top: 80px;
margin-bottom: 80px;
@media only screen and (max-width: $largest-mobile-screen) {
margin-top: 60px;
margin-bottom: 60px;
}
}

@mixin vertical-space-block-title() {
margin-top: 80px;
margin-bottom: 80px;
@media only screen and (max-width: $largest-mobile-screen) {
margin-top: 60px;
margin-bottom: 60px;
}
}

// Change of color
$color-block-change-vertical-spacing: 80px !default;
@mixin color-block-change-vertical-spacing() {
padding-top: $color-block-change-vertical-spacing;
padding-bottom: $color-block-change-vertical-spacing;
@media only screen and (max-width: $largest-mobile-screen) {
padding-top: $spacing-large;
padding-bottom: $spacing-large;
}
}

// Grids
$grid-block-vertical-spacing-top: 80px !default;
$grid-block-vertical-spacing-bottom: 80px !default;
@mixin grid-block-vertical-spacing-top() {
margin-top: $grid-block-vertical-spacing-top;
@media only screen and (max-width: $largest-mobile-screen) {
margin-top: $spacing-large;
}
}

// Footer
$footer-vertical-spacing-top: 80px !default;
Expand Down
188 changes: 109 additions & 79 deletions src/theme/blocks/_grid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,27 @@
margin-top: 0;
margin-bottom: 0;

&.is--first--of--block-type {
.column {
padding-top: 0;
&.is--first--of--block-type,
&.previous--is--same--block-type.previous--has--different--backgroundColor {
@media only screen and (min-width: $largest-mobile-screen) {
.ui.stackable.grid > .column {
padding-top: 0 !important;
}
}
.ui.stackable.grid > .column:first-child {
padding-top: 0 !important;
}
}
&.is--last--of--block-type {
.column {
padding-bottom: 0;

&.is--last--of--block-type,
&.next--is--same--block-type.next--has--different--backgroundColor {
@media only screen and (min-width: $largest-mobile-screen) {
.ui.stackable.grid > .column {
padding-bottom: 0 !important;
}
}
.ui.stackable.grid > .column:last-child {
padding-bottom: 0 !important;
}
}

Expand Down Expand Up @@ -41,7 +54,8 @@

h2 {
padding: 0;
margin-bottom: 20px;
margin-bottom: 20px !important;
@include text-heading-h3();
}

p {
Expand All @@ -53,11 +67,10 @@

.block-editor-teaser {
padding: 0;
margin: 0.5rem !important;
.teaser-item {
border: none !important;
margin-right: auto !important;
margin-left: auto !important;
margin: 10px !important;
.teaser-item.default {
padding-bottom: 0;
border: none;
}
}

Expand All @@ -70,6 +83,11 @@
padding: 0;
margin-bottom: 20px;
}

h2 {
margin-bottom: 20px !important;
@include text-heading-h3();
}
}

.block-editor-slate {
Expand All @@ -94,7 +112,7 @@
margin: 0 0 20px 0;
color: $white !important;
letter-spacing: 1px;
@include text-heading-h2();
@include text-heading-h3();
}

.description {
Expand Down Expand Up @@ -169,96 +187,108 @@
}

// Dynamic font sizes depending on number of columns for in-grid blocks
.block.gridBlock,
.block-editor-gridBlock {
.one {
.teaser-item .content h2 {
margin-bottom: 40px !important;
@include text-heading-h2();
}

.slate {
h2 {
#page-document .block.gridBlock,
#page-edit .block-editor-gridBlock,
#page-add .block-editor-gridBlock {
@media only screen and (min-width: $largest-mobile-screen) {
.one {
.teaser-item .content h2 {
margin-bottom: 40px !important;
@include text-heading-h2();
}
}
}

.two,
.three {
.teaser {
.teaser-item .content {
.slate {
h2 {
margin-bottom: 20px !important;
@include text-heading-h3();
margin-bottom: 40px !important;
@include text-heading-h2();
}
}
}
.image {
figcaption {
.title {
@include text-heading-h3();
margin: 0 0 20px 0;

.image {
figcaption {
.title {
@include text-heading-h2();
}
}
}
figure:after {
height: 70px;
}
}
.slate {
h2 {
margin-bottom: 20px !important;
@include text-heading-h3();
}
}
}

.four {
.teaser {
.teaser-item {
.image-wrapper {
margin-bottom: 20px !important;
}
.content {
.headline {
@include headtitle2();
}
.two,
.three {
.teaser {
.teaser-item .content {
h2 {
margin-bottom: 20px !important;
@include text-heading-h4();
}
p {
margin-bottom: 0;
@include text-heading-h3();
}
}
}
}

.image {
figcaption {
.title {
margin: 0 0 15px 0;
color: $white !important;
letter-spacing: 1px;
@include text-heading-h4();
.image {
figcaption {
.title {
@include text-heading-h3();
margin: 0 0 20px 0;
}
}
figure:after {
height: 70px;
}
}
figure:after {
height: 59px;
.slate {
h2 {
margin-bottom: 20px !important;
@include text-heading-h3();
}
}
}

.slate {
h2 {
margin-bottom: 20px !important;
@include text-heading-h4();
.four {
.teaser {
.teaser-item {
.image-wrapper {
margin-bottom: 20px !important;
}
.content {
.headline {
@include headtitle2();
}
h2 {
margin-bottom: 20px !important;
@include text-heading-h4();
}
p {
margin-bottom: 0;
}
}
}
}

p {
margin-bottom: 0;
.image {
figcaption {
.title {
margin: 0 0 15px 0;
color: $white !important;
letter-spacing: 1px;
@include text-heading-h4();
}
}
figure:after {
height: 59px;
}
}

padding-top: 20px !important;
.slate {
h2 {
margin-bottom: 20px !important;
@include text-heading-h4();
}

p {
margin-bottom: 0;
}

padding-top: 20px !important;
}
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/theme/blocks/_introduction.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

h2 {
@include highlight-title();
margin-bottom: 60px;
margin-bottom: $spacing-large;
@media only screen and (max-width: $largest-mobile-screen) {
margin-bottom: $spacing-medium;
}
}
}
Loading