Skip to content

Commit

Permalink
Fix all style linting errors + enforce in CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrause committed Nov 19, 2024
1 parent 22dbfe2 commit 236a6fd
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 21 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
"storybook:build": "storybook build --docs",
"check:types": "tsc --noEmit",
"lint:style": "stylelint 'src/**/*.scss'",
"lint:script": "biome",
"lint:script": "biome lint",
"lint": "npm run lint:style && npm run lint:script",
"test": "npm run check:types",
"test": "npm run check:types && npm run lint:style",
"test-ui": "vitest --ui",
"coverage": "vitest run --coverage",
"start": "npm run storybook:serve",
Expand Down
4 changes: 2 additions & 2 deletions package.json.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ const packageConfig = {
// Static analysis
'check:types': 'tsc --noEmit',
'lint:style': `stylelint 'src/**/*.scss'`,
'lint:script': 'biome',
'lint:script': 'biome lint',
'lint': 'npm run lint:style && npm run lint:script',

// Test
// Note: use `vitest run --root=. src/...` to run a single test file
//'test': 'vitest run --root=.', // Need to specify `--root=.` since the vite root is set to `./app`
'test': 'npm run check:types',
'test': 'npm run check:types && npm run lint:style',
'test-ui': 'vitest --ui',
'coverage': 'vitest run --coverage',

Expand Down
2 changes: 1 addition & 1 deletion src/components/navigations/Stepper/Stepper.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

&.bk-stepper--vertical {
.bk-stepper__item {
&:not(:first-child):not(:first-child) {
&:not(:first-child) {
margin-top: bk.$spacing-9;

.bk-stepper__item__circle {
Expand Down
3 changes: 1 addition & 2 deletions src/components/overlays/Toast/Toast.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@

@layer baklava.components {
.bk-toast {
width: auto !important; // Override style for .Toastify__toast-container
padding: 0 !important; // Override style for .Toastify__toast-container
width: 400px !important; // Override style for .Toastify__toast-container

&:has(.bk-close--dark) {
.bk-toast__body {
margin-right: bk.$spacing-4 !important; // Override style for .Toastify__toast-body
Expand Down
2 changes: 2 additions & 0 deletions src/components/overlays/Toast/ToastyOverride.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
|* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of
|* the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* stylelint-disable selector-class-pattern */

@use '../../../styling/defs.scss' as bk;

// Define styling to override react-toastify's styles, as overriding directly from Toast.module.scss is not possible.
Expand Down
18 changes: 9 additions & 9 deletions src/components/overlays/Tooltip/Tooltip.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
background: var(--c1);

&::before {
content: "";
content: '';
position: absolute;
z-index: -1;
inset: 0;
Expand Down Expand Up @@ -72,16 +72,16 @@
100% min(100%,var(--p) + var(--h)*tan(var(--a)/2)),
calc(100% + var(--h)) var(--p),
100% max(0% ,var(--p) - var(--h)*tan(var(--a)/2)));
border-image: conic-gradient(var(--c1) 0 0) fill 0/
max(0%,var(--p) - var(--h)*tan(var(--a)/2)) 0 max(0%,100% - var(--p) - var(--h)*tan(var(--a)/2)) var(--r)/0 var(--h) 0 0;
border-image: conic-gradient(var(--c1) 0 0) fill 0
/ max(0%,var(--p) - var(--h)*tan(var(--a)/2)) 0 max(0%,100% - var(--p) - var(--h)*tan(var(--a)/2)) var(--r)/0 var(--h) 0 0;

&::before {
clip-path: polygon(100% 0,0 0,0 100%,100% 100%,
calc(100% - var(--b)) min(100% - var(--b),var(--p) + var(--h)*tan(var(--a)/2) - var(--b)*tan(45deg - var(--a)/4)),
calc(100% + var(--h) - var(--b)/sin(var(--a)/2)) var(--p),
calc(100% - var(--b)) max( var(--b),var(--p) - var(--h)*tan(var(--a)/2) + var(--b)*tan(45deg - var(--a)/4)));
border-image: conic-gradient(var(--c2) 0 0) fill 0/
max(var(--b),var(--p) - var(--h)*tan(var(--a)/2)) 0 max(var(--b),100% - var(--p) - var(--h)*tan(var(--a)/2)) var(--r)/0 var(--h) 0 0;
border-image: conic-gradient(var(--c2) 0 0) fill 0
/ max(var(--b),var(--p) - var(--h)*tan(var(--a)/2)) 0 max(var(--b),100% - var(--p) - var(--h)*tan(var(--a)/2)) var(--r)/0 var(--h) 0 0;
}
}
@mixin bk-tooltip-arrow-bottom {
Expand All @@ -108,16 +108,16 @@
0 min(100%,var(--p) + var(--h)*tan(var(--a)/2)),
calc(-1*var(--h)) var(--p),
0 max(0% ,var(--p) - var(--h)*tan(var(--a)/2)));
border-image: conic-gradient(var(--c1) 0 0) fill 0/
max(0%,var(--p) - var(--h)*tan(var(--a)/2)) var(--r) max(0%,100% - var(--p) - var(--h)*tan(var(--a)/2)) 0/0 0 0 var(--h);
border-image: conic-gradient(var(--c1) 0 0) fill 0
/ max(0%,var(--p) - var(--h)*tan(var(--a)/2)) var(--r) max(0%,100% - var(--p) - var(--h)*tan(var(--a)/2)) 0/0 0 0 var(--h);

&::before {
clip-path: polygon(0 0,100% 0,100% 100%,0 100%,
var(--b) min(100% - var(--b),var(--p) + var(--h)*tan(var(--a)/2) - var(--b)*tan(45deg - var(--a)/4)),
calc(var(--b)/sin(var(--a)/2) - var(--h)) var(--p),
var(--b) max( var(--b),var(--p) - var(--h)*tan(var(--a)/2) + var(--b)*tan(45deg - var(--a)/4)));
border-image: conic-gradient(var(--c2) 0 0) fill 0/
max(var(--b),var(--p) - var(--h)*tan(var(--a)/2)) var(--r) max(var(--b),100% - var(--p) - var(--h)*tan(var(--a)/2)) 0/0 0 0 var(--h);
border-image: conic-gradient(var(--c2) 0 0) fill 0
/ max(var(--b),var(--p) - var(--h)*tan(var(--a)/2)) var(--r) max(var(--b),100% - var(--p) - var(--h)*tan(var(--a)/2)) 0/0 0 0 var(--h);
}
}

Expand Down
4 changes: 0 additions & 4 deletions src/layouts/AppLayout/Sidebar/Sidebar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
transition: all 300ms ease-in-out;
transition-property: width, grid-template-columns;

&.-collapsed {
width: var(--bk-sizing-5);
}

.bk-app-layout-sidebar__action-collapse {
margin: var(--bk-sizing-2);
padding: var(--bk-sizing-1) var(--bk-sizing-2);
Expand Down
2 changes: 1 addition & 1 deletion stylelint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default {
'rules': {
// Override `stylelint-config-standard-scss` rules
'scss/load-partial-extension': 'always',
'scss/at-import-partial-extension': 'always',
//'scss/at-import-partial-extension': 'always',
'comment-empty-line-before': null,
'comment-whitespace-inside': null,
'scss/comment-no-empty': null,
Expand Down

0 comments on commit 236a6fd

Please sign in to comment.