Skip to content

Commit

Permalink
Merge pull request #32 from fortanix/mkrause/241119-fix-style-lints
Browse files Browse the repository at this point in the history
Fix all style linting errors + enforce in CI
  • Loading branch information
nighto authored Nov 20, 2024
2 parents 255cefd + cca5e47 commit 3301760
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 28 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
17 changes: 8 additions & 9 deletions src/components/overlays/Toast/Toast.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

@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

Expand All @@ -15,7 +14,7 @@
margin-right: bk.$spacing-4 !important; // Override style for .Toastify__toast-body
}
}

.bk-toast--success,
.bk-toast--info,
.bk-toast--error {
Expand All @@ -42,21 +41,21 @@
// Override style for .Toastify__toast-theme--light
background-color: #{bk.$theme-notification-alert-background-default} !important;
}

.bk-toast__icon--success,
.bk-toast__icon--info,
.bk-toast__icon--error {
font-size: 18px;
}

.bk-toast__icon--success {
color: #{bk.$theme-notification-success-border-default};
}

.bk-toast__icon--info {
color: #{bk.$theme-notification-informational-border-default};
}

.bk-toast__icon--error {
color: #{bk.$theme-notification-alert-border-default};
}
Expand All @@ -83,7 +82,7 @@
flex-direction: column;
gap: bk.$spacing-1;
}

.bk-toast__message__title {
font-weight: bk.$font-weight-semibold;
}
Expand All @@ -107,15 +106,15 @@
opacity: 1 !important; // Override style for .Toastify__progress-bar
background-color: #{bk.$theme-progress-bar-fill} !important; // Override style for .Toastify__progress-bar
}

.bk-toast__button,
.bk-toast__copy-button {
padding: 0;
color: bk.$theme-notification-text-link;
font-size: 12px;
font-weight: bk.$font-weight-semibold;
}

.bk-toast__link {
font-weight: bk.$font-weight-semibold;
}
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 3301760

Please sign in to comment.