Skip to content
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
4 changes: 2 additions & 2 deletions inc/theme/class-gutenberg-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function enqueue_block_assets() {
'editor' => 'style',
);
foreach ( $files as $handle => $type ) {
$assets = require_once get_stylesheet_directory() . "/build/admin/{$handle}.asset.php";
$assets = require get_stylesheet_directory() . "/build/admin/{$handle}.asset.php";
if ( 'style' === $type || 'both' === $type ) {
wp_enqueue_style(
$handle,
Expand Down Expand Up @@ -80,4 +80,4 @@ public function register_theme_blocks() {
$blocks_path = get_template_directory() . '/build';
wp_register_block_types_from_metadata_collection( $blocks_path . '/js/blocks', $blocks_path . '/blocks-manifest.php' );
}
}
}
117 changes: 117 additions & 0 deletions src/styles/abstracts/_bs-breakpoints.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
@use "sass:map";
@use "sass:list";

$grid-breakpoints: (
xs: 0,
sm: 576px,
md: 768px,
lg: 992px,
xl: 1200px,
xxl: 1400px,
);

/**
* Media of at least the minimum breakpoint width.
* No query for the smallest breakpoint.
* Makes the @content apply to the given breakpoint and wider.
*/
@mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {
$min: map.get($breakpoints, $name);

@if $min {
@media screen and (width >= $min) {
@content;
}
} @else {
@content;
}
}

/**
* Media of at most the maximum breakpoint width.
* No query for the largest breakpoint.
* Makes the @content apply to the given breakpoint and narrower.
*/
@mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) {
$max: map.get($breakpoints, $name);

@if $max {
@media screen and (width <= $max) {
@content;
}
} @else {
@content;
}
}

/**
* Media that spans multiple breakpoint widths.
* Makes the @content apply between the min and max breakpoints
*/
@mixin media-breakpoint-between(
$lower,
$upper,
$breakpoints: $grid-breakpoints
) {
$min: map.get($breakpoints, $lower);
$max: map.get($breakpoints, $upper);

@if $min != null and $max != null {
@media (min-width: $min) and (max-width: $max) {
@content;
}
} @else if $max == null {
@include media-breakpoint-up($lower, $breakpoints) {
@content;
}
} @else if $min == null {
@include media-breakpoint-down($upper, $breakpoints) {
@content;
}
}
}

/**
* Media between the breakpoint's minimum and maximum widths.
* No minimum for the smallest breakpoint, and no maximum for the largest one.
* Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.
*/
@mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) {
$min: map.get($breakpoints, $name);
$next: get-next-breakpoint($name, $breakpoints);
$max: map.get($breakpoints, $next);

@if $min != null and $max != null {
@media (min-width: $min) and (max-width: $max) {
@content;
}
} @else if $max == null {
@include media-breakpoint-up($name, $breakpoints) {
@content;
}
} @else if $min == null {
@include media-breakpoint-down($next, $breakpoints) {
@content;
}
}
}

/**
* Returns the maximum width for the given breakpoint name.
* The maximum is calculated as the next breakpoint's minimum width.
* Returns null for the largest breakpoint.
*/
@function get-next-breakpoint($name, $breakpoints: $grid-breakpoints) {
$breakpoint-names: map.keys($breakpoints);
$n: list.index($breakpoint-names, $name);

@if not $n {
@error "breakpoint `#{$name}` not found in `#{$breakpoints}`";
}

@if $n < list.length($breakpoint-names) {
@return list.nth($breakpoint-names, $n + 1);
} @else {
@return null;
}
}
172 changes: 0 additions & 172 deletions src/styles/abstracts/_bs_breakpoints.scss

This file was deleted.

2 changes: 1 addition & 1 deletion src/styles/abstracts/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@forward "./bs_breakpoints";
@forward "./bs-breakpoints";
@use "./functions" as fn;

@mixin interaction() {
Expand Down
Loading