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

refactor(sass): switch to modules #23

Draft
wants to merge 1 commit into
base: master
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import './normalize';
@import './typography';
@use 'normalize' as *;
@use 'typography' as *;
@use '../utils/variables' as *;

html {
box-sizing: border-box;
Expand Down
2 changes: 2 additions & 0 deletions sassdoc/scss/base/_typography.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use '../utils/_variables' as *;

body {
font-family: $text-font-stack;
font-size: 100%;
Expand Down
18 changes: 9 additions & 9 deletions sassdoc/scss/main.scss
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
//
// Sass utils
//
@import "utils/variables";
@import "utils/functions";
@import "utils/grid";
@import "utils/mixins";
@import "utils/bem";
@import "utils/helpers";
@use "utils/variables" as *;
@use "utils/functions" as *;
@use "utils/grid" as *;
@use "utils/mixins" as *;
@use "utils/bem" as *;
@use "utils/helpers" as *;

//
// Vendors
//
@import "vendors/vendors";
@use "vendors";

//
// Base
//
@import "base/base";
@use "base";

//
// Partials
//
@import "partials/main";
@use "partials";
9 changes: 8 additions & 1 deletion sassdoc/scss/partials/_authors.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
@use 'sass:map';
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;
@use 'extends/helpers' as *;

@include b(authors) {
margin: rem($top-gutter) 0 rem($bottom-gutter) 0;

Expand All @@ -13,6 +19,7 @@

@include e(names-list) {
@extend %list-style;

margin-bottom: 0;
p {
margin-bottom: 0;
Expand All @@ -22,4 +29,4 @@
margin-top: rem(12px);
}
}
}
}
4 changes: 4 additions & 0 deletions sassdoc/scss/partials/_buttons.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@use 'sass:map';
@use '../utils/bem' as *;
@use 'extends/helpers' as *;

@include b(infra-button) {
@extend %button;
width: 100%;
Expand Down
5 changes: 5 additions & 0 deletions sassdoc/scss/partials/_defined-in.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;
@use 'extends/helpers' as *;

@include b(defined-in) {
margin: rem($top-margin-negative) 0 rem($bottom-gutter) 0;

Expand Down
5 changes: 5 additions & 0 deletions sassdoc/scss/partials/_definition-header.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;
@use 'extends/helpers' as *;

@include b(definition-header) {
display: flex;
align-items: center;
Expand Down
5 changes: 5 additions & 0 deletions sassdoc/scss/partials/_deprecation-message.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;
@use 'extends/helpers' as *;

@include b(deprecation) {
display: flex;
font-size: rem(15px);
Expand Down
5 changes: 5 additions & 0 deletions sassdoc/scss/partials/_description.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;
@use 'extends/helpers' as *;

@include b(description) {
margin-bottom: rem(16px);
font-size: rem(15px);
Expand Down
7 changes: 6 additions & 1 deletion sassdoc/scss/partials/_example.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;
@use 'extends/helpers' as *;

@include b(example) {
margin-bottom: rem(32px);

Expand Down Expand Up @@ -35,4 +40,4 @@
@include e(pre) {
padding: 24px;
}
}
}
5 changes: 5 additions & 0 deletions sassdoc/scss/partials/_header.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;
@use 'extends/helpers' as *;

@include b(header) {
display: flex;
flex-flow: column nowrap;
Expand Down
19 changes: 19 additions & 0 deletions sassdoc/scss/partials/_index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@forward 'main-section';
@forward 'authors';
@forward 'nav-group';
@forward 'subnav';
@forward 'search';
@forward 'header';
@forward 'footer';
@forward 'definition-header';
@forward 'defined-in';
@forward 'deprecation-message';
@forward 'usedby';
@forward 'require';
@forward 'source';
@forward 'parameters';
@forward 'infranav';
@forward 'description';
@forward 'example';
@forward 'buttons';
@forward 'returns';
9 changes: 7 additions & 2 deletions sassdoc/scss/partials/_main-section.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
@use 'sass:map';
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;

@include b(main-content) {
display: flex;
padding-top: rem(map-get($infra-head-height, 'mobile') + $secondary-header-height);
padding-top: rem(map.get($infra-head-height, 'mobile') + $secondary-header-height);

@media only screen and (min-width: 960px) {
padding-top: rem(map-get($infra-head-height, 'desktop') + $secondary-header-height);
padding-top: rem(map.get($infra-head-height, 'desktop') + $secondary-header-height);
}
}

Expand Down
21 changes: 0 additions & 21 deletions sassdoc/scss/partials/_main.scss

This file was deleted.

8 changes: 7 additions & 1 deletion sassdoc/scss/partials/_nav-group.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
@use 'sass:map';
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;
@use 'extends/helpers' as *;

@include b(nav-wrapper) {
position: relative;
width: rem($navbar-width);
Expand All @@ -7,7 +13,7 @@
@include e(nav) {
position: fixed;
width: rem($navbar-width);
height: calc(100% - #{map-get($infra-head-height, 'mobile') + $secondary-header-height + $search-input-height}px);
height: calc(100% - #{map.get($infra-head-height, 'mobile') + $secondary-header-height + $search-input-height}px);
background: $nav-bg;
border-right: 1px solid $nav-border-color;
overflow-x: hidden;
Expand Down
5 changes: 5 additions & 0 deletions sassdoc/scss/partials/_parameters.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;
@use 'extends/helpers' as *;

@include b (parameters-table) {
margin: rem($top-gutter) 0 rem($bottom-gutter) 0;

Expand Down
7 changes: 6 additions & 1 deletion sassdoc/scss/partials/_require.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;
@use 'extends/helpers' as *;

@include b(require) {
@include e(title) {
@extend %section-title;
Expand Down Expand Up @@ -37,4 +42,4 @@
@extend %type;
@extend %type-function;
}
}
}
5 changes: 5 additions & 0 deletions sassdoc/scss/partials/_returns.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;
@use 'extends/helpers' as *;

@include b(returns) {
margin: rem($top-gutter) 0 rem($bottom-gutter) 0;

Expand Down
10 changes: 8 additions & 2 deletions sassdoc/scss/partials/_search.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
@use 'sass:map';
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;
@use 'extends/helpers' as *;

@include b(search-form) {
position: fixed;
z-index: 4;
background: $nav-bg;
width: rem($navbar-width);
min-width: rem($navbar-width);
top: rem(map-get($infra-head-height, 'mobile') + $secondary-header-height);
top: rem(map.get($infra-head-height, 'mobile') + $secondary-header-height);

@media only screen and (min-width: 960px) {
top: rem(map-get($infra-head-height, 'desktop') + $secondary-header-height);
top: rem(map.get($infra-head-height, 'desktop') + $secondary-header-height);
}

@include e(input-container) {
Expand Down
7 changes: 6 additions & 1 deletion sassdoc/scss/partials/_source.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;
@use 'extends/helpers' as *;

@include b(source) {
margin-bottom: rem(32px);

Expand All @@ -10,4 +15,4 @@
border: 1px solid #ededed;
border-bottom: none;
}
}
}
7 changes: 6 additions & 1 deletion sassdoc/scss/partials/_subnav.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;
@use 'extends/helpers' as *;

@include b(subnav) {
list-style: none;
padding: 0 rem(8);
Expand Down Expand Up @@ -42,4 +47,4 @@
@include m(collapsed) {
display: none;
}
}
}
5 changes: 5 additions & 0 deletions sassdoc/scss/partials/_usedby.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
@use '../utils/bem' as *;
@use '../utils/functions' as *;
@use '../utils/variables' as *;
@use 'extends/helpers' as *;

@include b(usedby) {
margin: rem($top-gutter) 0 rem($bottom-gutter) 0;

Expand Down
20 changes: 12 additions & 8 deletions sassdoc/scss/partials/extends/_helpers.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@use 'sass:color';
@use '../../utils/variables' as *;
@use '../../utils/functions' as *;

%section-title {
color: $black;
font-weight: 400;
Expand All @@ -16,25 +20,25 @@
line-height: rem(24, 16);
font-weight: 600;
padding: 0 rem(2, 16);
border: 1px solid lighten($var-color, 32%);
background: lighten($var-color, 46%);
border: 1px solid color.adjust($var-color, $lightness: 32%);
background: color.adjust($var-color, $lightness: 46%);
}

%type-mixin {
border-color: lighten($mixin-color, 60%);
background: lighten($mixin-color, 70%);
border-color: color.adjust($mixin-color, $lightness: 60%);
background: color.adjust($mixin-color, $lightness: 70%);
color: $mixin-color;
}

%type-function {
border-color: lighten($function-color, 20%);
background: lighten($function-color, 48%);
border-color: color.adjust($function-color, $lightness: 20%);
background: color.adjust($function-color, $lightness: 48%);
color: $function-color;
}

%deprecated {
border-color: lighten($red, 32%);
background: lighten($red, 42%);
border-color: color.adjust($red, $lightness: 32%);
background: color.adjust($red, $lightness: 42%);
color: $red;
}

Expand Down
Loading
Loading