Skip to content

Commit

Permalink
remove unused mixins (#793)
Browse files Browse the repository at this point in the history
This commit removes css classes generated by UtilityLayouts.scss.
These classes (`l-row-\*`, `l-col-\*`,  `l-centeredColumn`) are not used
anywhere in the theme or SDK. Removing these auto-generated
classes reduces the css bundle size from 267KB to 194KB.

J=SLAP-1298
TEST=manual

loaded up a page, ran a search, asked for a direct answer
  • Loading branch information
oshi97 authored May 26, 2021
1 parent d489b9d commit cbcd3e3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 94 deletions.
91 changes: 0 additions & 91 deletions static/scss/answers/common/util/UtilityLayout.scss
Original file line number Diff line number Diff line change
@@ -1,97 +1,6 @@
@import "../variables";
@import "./Spacing.scss";

$generate-classes: false !default;
$col-gap: spacing(base) !default;
$splitting-points: (sm, md, lg) !default;


@if $generate-classes
{
.l-row
{
@include l-row;

&-separator
{
border-bottom:solid 1px #222;
}

&-vertical-margin
{
&-top
{
margin-top: $vertical-margin-top;

&-sm
{
margin-top: $vertical-margin-top / 2;
}
}

&-bottom
{
margin-bottom: $vertical-margin-top;

&-sm
{
margin-bottom: $vertical-margin-top / 2;
}
}
}
}

@for $colCount from 1 through $grid-columns
{
@each $start, $end, $direction in (lg, null, "up"),
(md, null, "up"),
(sm, null, "up"),
(null, md, "down"),
(null, sm, "down"),
(null, xs, "down")
{
$abbreviation: if($start, $start, $end);

.l-col-#{$abbreviation}-#{$colCount}-#{$direction}
{
@include bp($start, $end)
{
@include l-col($colCount, $grid-columns)
}
}
}
}

@for $colCount from 1 through $grid-columns
{
@each $start, $end in (lg, null),
(md, md),
(sm, sm),
(null, xs)
{
$abbreviation: if($start, $start, $end);

.l-col-#{$abbreviation}-#{$colCount}
{
@include bp($start, $end)
{
@include l-col($colCount, $grid-columns)
}
}
}
}

@each $bp in $splitting-points
{
@include l-Split($bp, $col-gap, '.l-Split');
}

.l-centeredColumn
{
@include l-centeredColumn;
}
}

.l-container
{
@include l-container;
Expand Down
3 changes: 0 additions & 3 deletions static/scss/answers/common/variables.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// utility mixin layout variables
$generate-classes: true;

$grid-gutter-width: 32px !default;
$grid-gutter-width-xs: $grid-gutter-width !default;
$grid-gutter-width-sm: $grid-gutter-width !default;
Expand Down

0 comments on commit cbcd3e3

Please sign in to comment.