Skip to content

Commit

Permalink
Fixing lint with autofix (primer#1757)
Browse files Browse the repository at this point in the history
* Fixing lint with autofix

* Change again

* last fix

* Fix needless disables
  • Loading branch information
jonrohan authored Nov 19, 2021
1 parent 1714778 commit fc514d0
Show file tree
Hide file tree
Showing 22 changed files with 88 additions and 83 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
],
"scripts": {
"dist": "script/dist.js",
"stylelint": "stylelint --quiet src/**/*.scss",
"stylelint": "stylelint --quiet 'src/**/*.scss'",
"eslint": "eslint deprecations.js __tests__ script",
"prepublishOnly": "script/prepublish",
"start": "yarn dev",
Expand Down
4 changes: 2 additions & 2 deletions src/color-modes/themes/dark.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "../../support/index.scss";
@import '../../support/index.scss';

@import "@primer/primitives/dist/scss/colors/_dark.scss";
@import '@primer/primitives/dist/scss/colors/_dark.scss';

@include color-mode-theme(dark) {
@include primer-colors-dark;
Expand Down
4 changes: 2 additions & 2 deletions src/color-modes/themes/dark_colorblind.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "../../support/index.scss";
@import '../../support/index.scss';

@import "@primer/primitives/dist/scss/colors/_dark_colorblind.scss";
@import '@primer/primitives/dist/scss/colors/_dark_colorblind.scss';

@include color-mode-theme(dark_colorblind) {
@include primer-colors-dark_colorblind;
Expand Down
4 changes: 2 additions & 2 deletions src/color-modes/themes/dark_dimmed.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "../../support/index.scss";
@import '../../support/index.scss';

@import "@primer/primitives/dist/scss/colors/_dark_dimmed.scss";
@import '@primer/primitives/dist/scss/colors/_dark_dimmed.scss';

@include color-mode-theme(dark_dimmed) {
@include primer-colors-dark_dimmed;
Expand Down
4 changes: 2 additions & 2 deletions src/color-modes/themes/dark_high_contrast.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "../../support/index.scss";
@import '../../support/index.scss';

@import "@primer/primitives/dist/scss/colors/_dark_high_contrast.scss";
@import '@primer/primitives/dist/scss/colors/_dark_high_contrast.scss';

@include color-mode-theme(dark_high_contrast) {
@include primer-colors-dark_high_contrast;
Expand Down
4 changes: 2 additions & 2 deletions src/color-modes/themes/light.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "../../support/index.scss";
@import '../../support/index.scss';

@import "@primer/primitives/dist/scss/colors/_light.scss";
@import '@primer/primitives/dist/scss/colors/_light.scss';

@include color-mode-theme(light, true) {
@include primer-colors-light;
Expand Down
4 changes: 2 additions & 2 deletions src/color-modes/themes/light_colorblind.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "../../support/index.scss";
@import '../../support/index.scss';

@import "@primer/primitives/dist/scss/colors/_light_colorblind.scss";
@import '@primer/primitives/dist/scss/colors/_light_colorblind.scss';

@include color-mode-theme(light_colorblind) {
@include primer-colors-light_colorblind;
Expand Down
4 changes: 2 additions & 2 deletions src/color-modes/themes/light_high_contrast.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "../../support/index.scss";
@import '../../support/index.scss';

@import "@primer/primitives/dist/scss/colors/_light_high_contrast.scss";
@import '@primer/primitives/dist/scss/colors/_light_high_contrast.scss';

@include color-mode-theme(light_high_contrast) {
@include primer-colors-light_high_contrast;
Expand Down
8 changes: 4 additions & 4 deletions src/docs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
// Only meant for the docs at https://primer.style/css

// CSS color variables
@import "./color-modes/index.scss";
@import './color-modes/index.scss';

// Global requirements
@import "./core/index.scss";
@import "./product/index.scss";
@import "./marketing/index.scss";
@import './core/index.scss';
@import './product/index.scss';
@import './marketing/index.scss';
8 changes: 4 additions & 4 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
// Should you need specific files, you can easily use separate `@import`s.

// CSS color variables
@import "./color-modes/index.scss";
@import './color-modes/index.scss';

// Global requirements
@import "./core/index.scss";
@import "./product/index.scss";
@import "./marketing/index.scss";
@import './core/index.scss';
@import './product/index.scss';
@import './marketing/index.scss';
22 changes: 14 additions & 8 deletions src/marketing/buttons/button.scss
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
.btn-mktg {
color: var(--color-canvas-default);
position: relative;
z-index: 1;
display: inline-block;
appearance: none !important;
// stylelint-disable-next-line primer/spacing
padding: 0.9rem 1.5rem 1.1rem;
// stylelint-disable-next-line primer/typography
font-size: 1rem;
font-weight: $font-weight-bold;
line-height: 1;
color: var(--color-canvas-default);
text-align: center;
white-space: nowrap;
vertical-align: middle;
user-select: none;
background: linear-gradient(180deg, rgba(255 255 255 / 0.15) 0%, rgba(255 255 255 / 0) 100%), var(--color-mktg-btn-bg) !important;
border: 0;
// stylelint-disable-next-line primer/borders
border-radius: 0.375rem;
background: linear-gradient(180deg, rgba(255 255 255 / 0.15) 0%, rgba(255 255 255 / 0) 100%),
var(--color-mktg-btn-bg) !important;
transition: box-shadow 0.2s;
appearance: none !important;

&::before {
position: absolute;
Expand All @@ -28,11 +27,11 @@
bottom: 0;
left: 0;
z-index: -1;
content: "";
// stylelint-disable-next-line primer/borders
content: '';
// stylelint-disable-next-line primer/colors
background: linear-gradient(180deg, rgba(255 255 255 / 0.15) 0%, rgba(255 255 255 / 0) 100%) !important;
border-radius: inherit;
opacity: 0;
background: linear-gradient(180deg, rgba(255 255 255 / 0.15) 0%, rgba(255 255 255 / 0) 100%) !important;
opacity: 0;
transition: opacity 0.2s;
background-blend-mode: normal;
Expand All @@ -44,8 +43,8 @@

&:focus,
&.focus {
box-shadow: var(--color-mktg-btn-shadow-focus), var(--color-mktg-btn-shadow-hover) !important;
outline: 0;
box-shadow: var(--color-mktg-btn-shadow-focus), var(--color-mktg-btn-shadow-hover) !important;
}

&:hover,
Expand All @@ -62,6 +61,7 @@

&:active {
outline: none;
// stylelint-disable-next-line primer/box-shadow
box-shadow: 0 0 0 transparent;

&::before {
Expand Down Expand Up @@ -89,10 +89,12 @@
}

&:active {
// stylelint-disable-next-line primer/box-shadow
box-shadow: var(--color-fg-default) 0 0 0 3px inset !important;
}

&:disabled {
// stylelint-disable-next-line primer/box-shadow
box-shadow: var(--color-fg-subtle) 0 0 0 1px inset !important;
}
}
Expand All @@ -117,14 +119,18 @@
}

.btn-signup-mktg {
// stylelint-disable-next-line primer/colors
color: #fff;
// stylelint-disable-next-line primer/colors
background: linear-gradient(180deg, rgba(52, 183, 89, 0.15) 0%, rgba(46, 164, 79, 0) 100%), rgb(46, 164, 79) !important;

&::before {
// stylelint-disable-next-line primer/colors
background: linear-gradient(180deg, rgba(52, 183, 89, 0.15) 0%, rgba(46, 164, 79, 0) 100%) !important;
}

&:focus {
// stylelint-disable-next-line primer/box-shadow
box-shadow: rgba(46, 164, 79, 0.45) 0 0 0 4px !important;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/marketing/buttons/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// support files
@import "../support/index.scss";
@import "./button.scss";
@import '../support/index.scss';
@import './button.scss';
4 changes: 2 additions & 2 deletions src/marketing/support/index.scss
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
@import "../../support/index.scss";
@import "./variables.scss";
@import '../../support/index.scss';
@import './variables.scss';
9 changes: 4 additions & 5 deletions src/marketing/support/variables.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// stylelint-disable unit-no-unknown
// Typography
$marketing-font-path: "/fonts/" !default;
$marketing-font-path: '/fonts/' !default;

$font-mktg: $body-font !default;
$font-weight-medium: 450 !default;
Expand Down Expand Up @@ -122,7 +121,7 @@ $transition-time: 0.4s !default;
$ease-mktg: cubic-bezier(0.16, 1, 0.3, 1) !default;

$marketing-position-variants: (
"": "",
md: "-md",
lg: "-lg",
'': '',
md: '-md',
lg: '-lg',
) !default;
4 changes: 2 additions & 2 deletions src/marketing/type/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// support files
@import "../support/index.scss";
@import "./typography.scss";
@import '../support/index.scss';
@import './typography.scss';
46 changes: 23 additions & 23 deletions src/marketing/type/typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,35 @@
$pairing-md: map-get($mktg-header-pairings, nth($sizes, 2));
$pairing-lg: map-get($mktg-header-pairings, nth($sizes, 3));

font-size: map-get($pairing, "size") !important;
line-height: map-get($pairing, "lh") !important;
@if (map-get($pairing, "size") >= $mktg-header-weight-threshold) { font-weight: $mktg-header-weight-large !important; }
font-size: map-get($pairing, 'size') !important;
line-height: map-get($pairing, 'lh') !important;
@if (map-get($pairing, 'size') >= $mktg-header-weight-threshold) { font-weight: $mktg-header-weight-large !important; }

@if (nth($sizes, 1) != nth($sizes, 2)) {
@include breakpoint(md) {
font-size: map-get($pairing-md, "size") !important;
line-height: map-get($pairing-md, "lh") !important;
font-size: map-get($pairing-md, 'size') !important;
line-height: map-get($pairing-md, 'lh') !important;

@if (map-get($pairing-md, "size") >= $mktg-header-spacing-threshold and map-get($pairing, "size") < $mktg-header-spacing-threshold) {
@if (map-get($pairing-md, 'size') >= $mktg-header-spacing-threshold and map-get($pairing, 'size') < $mktg-header-spacing-threshold) {
letter-spacing: $mktg-header-spacing-large !important;
}

@if (map-get($pairing-md, "size") >= $mktg-header-weight-threshold and map-get($pairing, "size") < $mktg-header-weight-threshold) {
@if (map-get($pairing-md, 'size') >= $mktg-header-weight-threshold and map-get($pairing, 'size') < $mktg-header-weight-threshold) {
font-weight: $mktg-header-weight-large !important;
}
}
}

@if (nth($sizes, 2) != nth($sizes, 3)) {
@include breakpoint(lg) {
font-size: map-get($pairing-lg, "size") !important;
line-height: map-get($pairing-lg, "lh") !important;
font-size: map-get($pairing-lg, 'size') !important;
line-height: map-get($pairing-lg, 'lh') !important;

@if (map-get($pairing-lg, "size") >= $mktg-header-spacing-threshold and map-get($pairing-md, "size") < $mktg-header-spacing-threshold) {
@if (map-get($pairing-lg, 'size') >= $mktg-header-spacing-threshold and map-get($pairing-md, 'size') < $mktg-header-spacing-threshold) {
letter-spacing: $mktg-header-spacing-large !important;
}

@if (map-get($pairing-lg, "size") >= $mktg-header-weight-threshold and map-get($pairing-md, "size") < $mktg-header-weight-threshold) {
@if (map-get($pairing-lg, 'size') >= $mktg-header-weight-threshold and map-get($pairing-md, 'size') < $mktg-header-weight-threshold) {
font-weight: $mktg-header-weight-large !important;
}
}
Expand All @@ -73,36 +73,36 @@
$pairing-md: map-get($mktg-body-pairings, nth($sizes, 2));
$pairing-lg: map-get($mktg-body-pairings, nth($sizes, 3));

font-size: map-get($pairing, "size") !important;
line-height: map-get($pairing, "lh") !important;
@if (map-get($pairing, "size") >= $mktg-body-spacing-threshold) { letter-spacing: $mktg-body-spacing-large !important; }
@if (map-get($pairing, "size") >= $mktg-body-weight-threshold) { font-weight: $font-weight-semibold; }
font-size: map-get($pairing, 'size') !important;
line-height: map-get($pairing, 'lh') !important;
@if (map-get($pairing, 'size') >= $mktg-body-spacing-threshold) { letter-spacing: $mktg-body-spacing-large !important; }
@if (map-get($pairing, 'size') >= $mktg-body-weight-threshold) { font-weight: $font-weight-semibold; }

@if (nth($sizes, 1) != nth($sizes, 2)) {
@include breakpoint(md) {
font-size: map-get($pairing-md, "size") !important;
line-height: map-get($pairing-md, "lh") !important;
font-size: map-get($pairing-md, 'size') !important;
line-height: map-get($pairing-md, 'lh') !important;

@if (map-get($pairing-md, "size") >= $mktg-body-spacing-threshold and map-get($pairing, "size") < $mktg-body-spacing-threshold) {
@if (map-get($pairing-md, 'size') >= $mktg-body-spacing-threshold and map-get($pairing, 'size') < $mktg-body-spacing-threshold) {
letter-spacing: $mktg-body-spacing-large !important;
}

@if (map-get($pairing-md, "size") >= $mktg-body-weight-threshold and map-get($pairing, "size") < $mktg-body-weight-threshold) {
@if (map-get($pairing-md, 'size') >= $mktg-body-weight-threshold and map-get($pairing, 'size') < $mktg-body-weight-threshold) {
font-weight: $font-weight-medium;
}
}
}

@if (nth($sizes, 2) != nth($sizes, 3)) {
@include breakpoint(lg) {
font-size: map-get($pairing-lg, "size") !important;
line-height: map-get($pairing-lg, "lh") !important;
font-size: map-get($pairing-lg, 'size') !important;
line-height: map-get($pairing-lg, 'lh') !important;

@if (map-get($pairing-lg, "size") >= $mktg-body-spacing-threshold and map-get($pairing-md, "size") < $mktg-body-spacing-threshold) {
@if (map-get($pairing-lg, 'size') >= $mktg-body-spacing-threshold and map-get($pairing-md, 'size') < $mktg-body-spacing-threshold) {
letter-spacing: $mktg-body-spacing-large !important;
}

@if (map-get($pairing-lg, "size") >= $mktg-body-weight-threshold and map-get($pairing-md, "size") < $mktg-body-weight-threshold) {
@if (map-get($pairing-lg, 'size') >= $mktg-body-weight-threshold and map-get($pairing-md, 'size') < $mktg-body-weight-threshold) {
font-weight: $font-weight-medium;
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/marketing/utilities/index.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@import "../support/index.scss";
@import '../support/index.scss';
// utilities
@import "./animations.scss";
@import "./borders.scss";
@import "./filters.scss";
@import "./layout.scss";
@import './animations.scss';
@import './borders.scss';
@import './filters.scss';
@import './layout.scss';
2 changes: 1 addition & 1 deletion src/marketing/utilities/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@each $breakpoint, $variant in $marketing-position-variants {
@include breakpoint($breakpoint) {
@each $scale, $size in $spacer-map-extended {
@if ($size != 0 or $variant != "") {
@if ($size != 0 or $variant != '') {
.top#{$variant}-#{$scale} { top: $size !important; }
.right#{$variant}-#{$scale} { right: $size !important; }
.bottom#{$variant}-#{$scale} { bottom: $size !important; }
Expand Down
10 changes: 5 additions & 5 deletions src/support/mixins/layout.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Responsive media queries

@mixin breakpoint($breakpoint) {
@if $breakpoint == "" {
@if $breakpoint == '' {
@content;
}

Expand All @@ -19,8 +19,8 @@

// If the key doesn't exist in the map
@else {
@warn "Unfortunately, no value could be retrieved from `#{$breakpoint}`. "
+ "Please make sure it is defined in `$breakpoints` map.";
@warn 'Unfortunately, no value could be retrieved from `#{$breakpoint}`. '
+ 'Please make sure it is defined in `$breakpoints` map.';
}
}
}
Expand All @@ -47,12 +47,12 @@
@mixin clearfix {
&::before {
display: table;
content: "";
content: '';
}

&::after {
display: table;
clear: both;
content: "";
content: '';
}
}
2 changes: 1 addition & 1 deletion src/support/mixins/misc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
width: 8px;
height: 16px;
pointer-events: none;
content: " ";
content: ' ';
clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

Expand Down
Loading

0 comments on commit fc514d0

Please sign in to comment.