Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

fix(prefix): make use of -- as a prefix standard #50

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
18 changes: 9 additions & 9 deletions examples/bootstrap/css-gridish/scss/_core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ body {
margin: 0;
}

.#{$prefix}-container {
.#{$prefix}--container {
box-sizing: border-box;
margin-left: auto;
margin-right: auto;
Expand All @@ -20,15 +20,15 @@ body {
width: 100vw;
}

.#{$prefix}-container--left {
.#{$prefix}--container--left {
margin-left: 0;
}

.#{$prefix}-container--right {
.#{$prefix}--container--right {
margin-right: 0;
}

.#{$prefix}-grid {
.#{$prefix}--grid {
align-items: flex-start;
box-sizing: border-box;
@if $includeFlexFallback {
Expand All @@ -49,30 +49,30 @@ body {
}
}

[class*="#{$prefix}-padding"] {
[class*="#{$prefix}--padding"] {
box-sizing: border-box;
}

// Rules needed in legacy, but needed to change in CSS Grid
@if $includeFlexFallback {
.#{$prefix}-grid > * {
.#{$prefix}--grid > * {
width: 100%;
}

@supports (display: grid) {
.#{$prefix}-grid {
.#{$prefix}--grid {
align-items: unset;
}

.#{$prefix}-grid > * {
.#{$prefix}--grid > * {
width: initial;
}
}
}

// Rules not needed in legacy, but needed in CSS Grid
@supports (display: grid) {
.#{$prefix}-grid > * {
.#{$prefix}--grid > * {
height: 100%;
}
}
Expand Down
92 changes: 46 additions & 46 deletions examples/bootstrap/css-gridish/scss/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
@if (map-get($breakpoint, columns) != null) {
$columnSize: get-fluid-size($breakpointName, 1);

.#{$prefix}-grid {
.#{$prefix}--grid {
@if is-same-breakpoint($breakpoint, $first) {
grid-auto-rows: minmax($rowHeight * 1rem, min-content);
}
grid-template-columns: repeat(auto-fill, $columnSize);

&.#{$prefix}-grid--fixed-columns {
&.#{$prefix}--grid--fixed-columns {
grid-template-columns: repeat(
auto-fill,
map-get($breakpoint, breakpoint) *
Expand All @@ -18,7 +18,7 @@
);
}

&.#{$prefix}-grid--fluid-rows {
&.#{$prefix}--grid--fluid-rows {
grid-auto-rows: $columnSize;
}

Expand All @@ -34,7 +34,7 @@
// Generate variables for commonly used rows
@mixin grid-heights-fixed($rows) {
@for $i from 1 to $rows {
--#{$prefix}-height-#{$i}: get-fixed-size($i);
--#{$prefix}--height-#{$i}: get-fixed-size($i);
}
}

Expand Down Expand Up @@ -67,7 +67,7 @@
$columnMultiplier
);

.#{$prefix}-grid__col--#{$currentName}--#{$i} {
.#{$prefix}--grid__col--#{$currentName}--#{$i} {
@if $includeFlexFallback {
// If second-to-last media query, apply max-width instead of remaking classes in last media query
@if $isSecondToLast {
Expand All @@ -78,14 +78,14 @@
grid-column: span #{$columnMultiplier};

@if is-same-breakpoint($breakpoint, $last) == false {
&.#{$prefix}-grid > *:not([class*="#{$prefix}-grid__col"]) {
&.#{$prefix}--grid > *:not([class*="#{$prefix}--grid__col"]) {
grid-column: span #{$i};
}
}
}

.#{$prefix}-grid--fluid-rows
> .#{$prefix}-grid__height--#{$currentName}--#{$i} {
.#{$prefix}--grid--fluid-rows
> .#{$prefix}--grid__height--#{$currentName}--#{$i} {
grid-row: span $i;
@if $includeFlexFallback {
height: $columnSize;
Expand All @@ -103,7 +103,7 @@

@if $includeFlexFallback {
@if is-same-breakpoint($breakpoint, $last) {
[class*="#{$prefix}-grid__col--"] {
[class*="#{$prefix}--grid__col--"] {
min-width: 0;
}
}
Expand All @@ -112,12 +112,12 @@

// Set the height of an item for legacy grid
@mixin grid-legacy-heights($name) {
.#{$prefix}-grid__height--#{$name}--0 {
.#{$prefix}--grid__height--#{$name}--0 {
height: 0;
min-height: 0;
}
@for $i from 1 to $rows {
.#{$prefix}-grid__height--#{$name}--#{$i} {
.#{$prefix}--grid__height--#{$name}--#{$i} {
grid-row: span $i;
@if $includeFlexFallback {
height: get-fixed-size($i);
Expand Down Expand Up @@ -146,18 +146,18 @@
@if map-get(nth($currentBreakpoint, 2), breakpoint) <
map-get($breakpoint, breakpoint)
{
.#{$prefix}-grid__col--#{nth($currentBreakpoint, 1)}--0--only {
.#{$prefix}--grid__col--#{nth($currentBreakpoint, 1)}--0--only {
display: block;
}
}
}

[class*="#{$prefix}-grid__col--#{$name}--"] {
[class*="#{$prefix}--grid__col--#{$name}--"] {
display: block;
}

.#{$prefix}-grid__col--#{$name}--0,
.#{$prefix}-grid__col--#{$name}--0--only {
.#{$prefix}--grid__col--#{$name}--0,
.#{$prefix}--grid__col--#{$name}--0--only {
display: none;
}
}
Expand Down Expand Up @@ -199,14 +199,14 @@
$previousMargin !=
"0"
{
[class^="#{$prefix}-container__bleed--#{$previousName}"],
[class^="#{$prefix}-container__break--#{$previousName}"] {
[class^="#{$prefix}--container__bleed--#{$previousName}"],
[class^="#{$prefix}--container__break--#{$previousName}"] {
margin-left: 0;
margin-right: 0;
padding-left: 0;
padding-right: 0;

&[class^="#{$prefix}-padding"] {
&[class^="#{$prefix}--padding"] {
padding-left: $padding;
padding-right: $padding;
}
Expand All @@ -224,53 +224,53 @@
$marginPlusPadding: $margin;
}

.#{$prefix}-container {
.#{$prefix}--container {
margin-left: auto;
margin-right: auto;
padding-left: $margin;
padding-right: $margin;
}

.#{$prefix}-container--left {
.#{$prefix}--container--left {
margin-left: 0;
}

.#{$prefix}-container--right {
.#{$prefix}--container--right {
margin-right: 0;
}

.#{$prefix}-container__bleed--#{$nameToUse},
.#{$prefix}-container__bleed--#{$nameToUse}--left,
.#{$prefix}-container__break--#{$nameToUse},
.#{$prefix}-container__break--#{$nameToUse}--left {
.#{$prefix}--container__bleed--#{$nameToUse},
.#{$prefix}--container__bleed--#{$nameToUse}--left,
.#{$prefix}--container__break--#{$nameToUse},
.#{$prefix}--container__break--#{$nameToUse}--left {
margin-left: -#{$margin};
}

.#{$prefix}-container__bleed--#{$nameToUse},
.#{$prefix}-container__bleed--#{$nameToUse}--right,
.#{$prefix}-container__break--#{$nameToUse},
.#{$prefix}-container__break--#{$nameToUse}--right {
.#{$prefix}--container__bleed--#{$nameToUse},
.#{$prefix}--container__bleed--#{$nameToUse}--right,
.#{$prefix}--container__break--#{$nameToUse},
.#{$prefix}--container__break--#{$nameToUse}--right {
margin-right: -#{$margin};
}

.#{$prefix}-container__bleed--#{$nameToUse},
.#{$prefix}-container__bleed--#{$nameToUse}--left {
.#{$prefix}--container__bleed--#{$nameToUse},
.#{$prefix}--container__bleed--#{$nameToUse}--left {
padding-left: $margin;

&.#{$prefix}-padding,
&.#{$prefix}-padding--horizontal,
&.#{$prefix}-padding--left {
&.#{$prefix}--padding,
&.#{$prefix}--padding--horizontal,
&.#{$prefix}--padding--left {
padding-left: $marginPlusPadding;
}
}

.#{$prefix}-container__bleed--#{$nameToUse},
.#{$prefix}-container__bleed--#{$nameToUse}--right {
.#{$prefix}--container__bleed--#{$nameToUse},
.#{$prefix}--container__bleed--#{$nameToUse}--right {
padding-right: $margin;

&.#{$prefix}-padding,
&.#{$prefix}-padding--horizontal,
&.#{$prefix}-padding--right {
&.#{$prefix}--padding,
&.#{$prefix}--padding--horizontal,
&.#{$prefix}--padding--right {
padding-right: $marginPlusPadding;
}
}
Expand All @@ -282,32 +282,32 @@
@if (map-get($breakpoint, padding) != null) {
$padding: map-get($breakpoint, padding);

.#{$prefix}-padding {
.#{$prefix}--padding {
padding: $padding;
}

.#{$prefix}-padding--bottom {
.#{$prefix}--padding--bottom {
padding-bottom: $padding;
}

.#{$prefix}-padding--left {
.#{$prefix}--padding--left {
padding-left: $padding;
}

.#{$prefix}-padding--right {
.#{$prefix}--padding--right {
padding-right: $padding;
}

.#{$prefix}-padding--top {
.#{$prefix}--padding--top {
padding-top: $padding;
}

.#{$prefix}-padding--horizontal {
.#{$prefix}--padding--horizontal {
padding-left: $padding;
padding-right: $padding;
}

.#{$prefix}-padding--vertical {
.#{$prefix}--padding--vertical {
padding-bottom: $padding;
padding-top: $padding;
}
Expand Down
10 changes: 5 additions & 5 deletions examples/bootstrap/css-gridish/scss/bootstrap-grid-legacy.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,24 @@ $includeFlexFallback: true;
@import "core.scss";

@supports (display: grid) {
.#{$prefix}-grid > *,
.#{$prefix}-grid > [class*="#{$prefix}-grid__col--"] {
.#{$prefix}--grid > *,
.#{$prefix}--grid > [class*="#{$prefix}--grid__col--"] {
min-width: initial;
max-width: initial;
width: initial;

&.#{$prefix}-grid {
&.#{$prefix}--grid {
display: grid;
}
}

.#{$prefix}-grid > [class*="#{$prefix}-grid__height--"] {
.#{$prefix}--grid > [class*="#{$prefix}--grid__height--"] {
height: unset;
max-height: unset;
min-height: initial;
}
}

.#{$prefix}-grid > script {
.#{$prefix}--grid > script {
display: none;
}
18 changes: 9 additions & 9 deletions examples/carbon/css-gridish/scss/_core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ body {
margin: 0;
}

.#{$prefix}-container {
.#{$prefix}--container {
box-sizing: border-box;
margin-left: auto;
margin-right: auto;
Expand All @@ -20,15 +20,15 @@ body {
width: 100vw;
}

.#{$prefix}-container--left {
.#{$prefix}--container--left {
margin-left: 0;
}

.#{$prefix}-container--right {
.#{$prefix}--container--right {
margin-right: 0;
}

.#{$prefix}-grid {
.#{$prefix}--grid {
align-items: flex-start;
box-sizing: border-box;
@if $includeFlexFallback {
Expand All @@ -49,30 +49,30 @@ body {
}
}

[class*="#{$prefix}-padding"] {
[class*="#{$prefix}--padding"] {
box-sizing: border-box;
}

// Rules needed in legacy, but needed to change in CSS Grid
@if $includeFlexFallback {
.#{$prefix}-grid > * {
.#{$prefix}--grid > * {
width: 100%;
}

@supports (display: grid) {
.#{$prefix}-grid {
.#{$prefix}--grid {
align-items: unset;
}

.#{$prefix}-grid > * {
.#{$prefix}--grid > * {
width: initial;
}
}
}

// Rules not needed in legacy, but needed in CSS Grid
@supports (display: grid) {
.#{$prefix}-grid > * {
.#{$prefix}--grid > * {
height: 100%;
}
}
Expand Down
Loading