Skip to content

Commit

Permalink
add variable --layout-spacing-sides for padding-default mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
denniserdmann committed Jun 12, 2024
1 parent 9bdd723 commit 7ecaefb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ html {
// --------------------------------------------------

// BASE/LAYOUT
--layout-spacing-sides: var(--base-spacing-unit;)
--layout-wrapper-background: transparent;
--layout-header-background: var(--color-page-background);
--layout-header-color: var(--color-text);
Expand Down
26 changes: 14 additions & 12 deletions scss/mixins/_general.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@
}
}

@mixin padding-default($padding: var(--base-spacing-unit)) {
padding-left: $padding;
@mixin padding-default($padding: var(--layout-spacing-sides)) {
padding-left: $padding;
padding-right: $padding;
}

// make-row
@mixin make-row($total-columns: $grid-columns, $grid-gutter: var(--grid-gutter)) {
@mixin make-row(
$total-columns: $grid-columns,
$grid-gutter: var(--grid-gutter)
) {
display: grid;
grid-template-columns: repeat($total-columns, 1fr);
grid-column-gap: $grid-gutter;
Expand All @@ -47,7 +50,7 @@
@mixin column-floating() {
grid-column: 1 / -1;

@supports not(display: grid) {
@supports not (display: grid) {
padding-left: var(--grid-gutter-half);
padding-right: var(--grid-gutter-half);
}
Expand Down Expand Up @@ -110,16 +113,15 @@
width: 1px;
}


// Functions
// function map-deep-get()
// function to get a value from a nested map, see _type.scss for usage
//
@function map-deep-get($map, $keys...) {
@each $key in $keys {
$map: map-get($map, $key);
}
@return $map;
@each $key in $keys {
$map: map-get($map, $key);
}
@return $map;
}

// function headings()
Expand All @@ -132,10 +134,10 @@
// #{headings(2,4) { … } will result in
// h2,h3,h4 { … }
// ---
@function headings($first:1, $last:6) {
@function headings($first: 1, $last: 6) {
@if $first == $last {
@return 'h#{$first}';
@return 'h#{$first}';
} @else {
@return 'h#{$first},' + headings($first+1, $last);
@return 'h#{$first},' + headings($first + 1, $last);
}
}

0 comments on commit 7ecaefb

Please sign in to comment.