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

Address Sass '@import' deprecation warnings #848

Draft
wants to merge 2 commits into
base: 2.5-stable
Choose a base branch
from
Draft
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Refers to snippets of code within the `_includes` directory that can be inserted
Refers to `.scss` files within the `_sass` directory that define the theme's styles.

- `minima.scss` — The core file imported by preprocessed `main.scss`, it defines the variable defaults for the theme and also further imports sass partials to supplement itself.
- `minima/_common.scss` — Common styling and mixins leveraged throughout the minima theme.
- `minima/_base.scss` — Resets and defines base styles for various HTML elements.
- `minima/_layout.scss` — Defines the visual style for various layouts.
- `minima/_syntax-highlighting.scss` — Defines the styles for syntax-highlighting.
Expand Down
51 changes: 3 additions & 48 deletions _sass/minima.scss
Original file line number Diff line number Diff line change
@@ -1,51 +1,6 @@
@charset "utf-8";

// Define defaults for each variable.

$base-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default;
$base-font-size: 16px !default;
$base-font-weight: 400 !default;
$small-font-size: $base-font-size * 0.875 !default;
$base-line-height: 1.5 !default;

$spacing-unit: 30px !default;

$text-color: #111 !default;
$background-color: #fdfdfd !default;
$brand-color: #2a7ae2 !default;

$grey-color: #828282 !default;
$grey-color-light: lighten($grey-color, 40%) !default;
$grey-color-dark: darken($grey-color, 25%) !default;

$table-text-align: left !default;

// Width of the content area
$content-width: 800px !default;

$on-palm: 600px !default;
$on-laptop: 800px !default;

// Use media queries like this:
// @include media-query($on-palm) {
// .wrapper {
// padding-right: $spacing-unit / 2;
// padding-left: $spacing-unit / 2;
// }
// }
@mixin media-query($device) {
@media screen and (max-width: $device) {
@content;
}
}

@mixin relative-font-size($ratio) {
font-size: $base-font-size * $ratio;
}

// Import partials.
@import
"minima/base",
"minima/layout",
"minima/syntax-highlighting"
;
@use "minima/base" as *;
@use "minima/layout" as *;
@use "minima/syntax-highlighting" as *;
4 changes: 4 additions & 0 deletions _sass/minima/_base.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@charset "utf-8";

@use "common" as *;

/**
* Reset some basic elements
*/
Expand Down
44 changes: 44 additions & 0 deletions _sass/minima/_common.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
@charset "utf-8";

// Define defaults for each variable.

$base-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default;
$base-font-size: 16px !default;
$base-font-weight: 400 !default;
$small-font-size: $base-font-size * 0.875 !default;
$base-line-height: 1.5 !default;

$spacing-unit: 30px !default;

$text-color: #111 !default;
$background-color: #fdfdfd !default;
$brand-color: #2a7ae2 !default;

$grey-color: #828282 !default;
$grey-color-light: lighten($grey-color, 40%) !default;
$grey-color-dark: darken($grey-color, 25%) !default;

$table-text-align: left !default;

// Width of the content area
$content-width: 800px !default;

$on-palm: 600px !default;
$on-laptop: 800px !default;

// Use media queries like this:
// @include media-query($on-palm) {
// .wrapper {
// padding-right: $spacing-unit / 2;
// padding-left: $spacing-unit / 2;
// }
// }
@mixin media-query($device) {
@media screen and (max-width: $device) {
@content;
}
}

@mixin relative-font-size($ratio) {
font-size: $base-font-size * $ratio;
}
5 changes: 5 additions & 0 deletions _sass/minima/_layout.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@charset "utf-8";

@use "common" as *;
@use "base" as *;

/**
* Site header
*/
Expand Down
4 changes: 4 additions & 0 deletions _sass/minima/_syntax-highlighting.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@charset "utf-8";

@use "base" as *;

/**
* Syntax highlighting styles
*/
Expand Down
2 changes: 1 addition & 1 deletion assets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Only the main Sass file needs front matter (the dashes are enough)
---

@import "minima";
@forward "minima";