Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds stylelint #2453

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
19 changes: 19 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": ["stylelint-config-standard-scss", "stylelint-config-prettier-scss"],
"plugins": ["stylelint-order"],
"rules": {
"alpha-value-notation": "number",
"block-no-empty": null,
"color-function-notation": "legacy",
"custom-property-pattern": null,
"font-family-no-missing-generic-family-keyword": [
true,
{
"ignoreFontFamilies": ["codicon", "glicons"]
}
],
"order/order": ["custom-properties", "declarations"],
"no-invalid-position-at-import-rule": null,
"selector-class-pattern": null
}
}
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"css.validate": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": true,
"source.fixAll.stylelint": true
},
"eslint.packageManager": "yarn",
"files.associations": {
Expand Down Expand Up @@ -45,10 +47,13 @@
"[html][javascript][json][jsonc][markdown][scss][svg][typescript][typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"less.validate": false,
"npm.packageManager": "yarn",
"scss.validate": false,
"search.exclude": {
"**/dist": true
},
"stylelint.validate": ["css", "scss"],
"typescript.preferences.importModuleSpecifier": "project-relative",
"typescript.tsdk": "node_modules\\typescript\\lib"
}
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13626,7 +13626,9 @@
"graph:unlink": "yarn unlink @gitkraken/gitkraken-components && yarn install --force",
"icons:apply": "node ./scripts/applyIconsContribution.js",
"icons:svgo": "svgo -q -f ./images/icons/ --config svgo.config.js",
"lint": "eslint \"src/**/*.ts?(x)\" --fix",
"lint": "yarn run lint:scripts && yarn run lint:styles",
"lint:scripts": "eslint \"src/**/*.ts?(x)\" --fix",
"lint:styles": "stylelint \"src/**/*.scss\" --fix",
"lint:webviews": "eslint \"src/webviews/apps/**/*.ts?(x)\" --fix",
"package": "vsce package --yarn",
"package-pre": "yarn run patch-pre && yarn run package --pre-release",
Expand Down Expand Up @@ -13719,6 +13721,10 @@
"sass-loader": "13.2.2",
"schema-utils": "4.0.1",
"sharp": "0.32.1",
"stylelint": "^14.16.1",
"stylelint-config-prettier-scss": "^0.0.1",
"stylelint-config-standard-scss": "^6.1.0",
"stylelint-order": "^6.0.1",
"svgo": "3.0.2",
"terser-webpack-plugin": "5.3.8",
"ts-loader": "9.4.2",
Expand Down
31 changes: 28 additions & 3 deletions src/webviews/apps/commitDetails/commitDetails.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
// generic resets
html {
font-size: 62.5%;

// box-sizing: border-box;
font-family: var(--font-family);
}

*,
*:before,
*:after {
*::before,
*::after {
box-sizing: border-box;
}

Expand Down Expand Up @@ -67,6 +68,7 @@ body {

a {
text-decoration: none;

&:hover {
text-decoration: underline;
}
Expand All @@ -81,6 +83,7 @@ ul {
.bulleted {
list-style: disc;
padding-left: 1.2em;

> li + li {
margin-top: 0.25em;
}
Expand Down Expand Up @@ -167,6 +170,7 @@ ul {
.vscode-dark & {
background-color: var(--color-background--lighten-075);
}

.vscode-high-contrast-light &,
.vscode-light & {
background-color: var(--color-background--darken-075);
Expand Down Expand Up @@ -196,10 +200,12 @@ ul {
&:hover {
color: var(--vscode-foreground);
text-decoration: none;

.vscode-high-contrast &,
.vscode-dark & {
background-color: var(--color-background--lighten-10);
}

.vscode-high-contrast-light &,
.vscode-light & {
background-color: var(--color-background--darken-10);
Expand All @@ -208,10 +214,12 @@ ul {

&.is-selected {
color: var(--vscode-foreground);

.vscode-high-contrast &,
.vscode-dark & {
background-color: var(--color-background--lighten-15);
}

.vscode-high-contrast-light &,
.vscode-light & {
background-color: var(--color-background--darken-15);
Expand Down Expand Up @@ -263,23 +271,29 @@ ul {
// margin-top: 0.25rem;
// }
}

&__link {
width: 100%;
color: inherit;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}

&__type {
}

&__filename {
}

&__path {
font-size: 0.9em;
}

&__actions {
flex: none;
}

&__action {
}
}
Expand All @@ -297,11 +311,13 @@ ul {
justify-content: center;
align-items: center;
}

&__media &__icon {
width: 2.8rem;
height: 2.8rem;
font-size: 2.8rem;
}

&__date {
font-size: 1.2rem;
}
Expand Down Expand Up @@ -343,6 +359,7 @@ ul {
bottom: 0.4rem;
}
}

p {
margin: 0;
opacity: 0.5;
Expand Down Expand Up @@ -397,6 +414,7 @@ ul {
.vscode-dark & {
background-color: var(--color-background--lighten-15);
}

.vscode-light & {
background-color: var(--color-background--darken-15);
}
Expand All @@ -406,6 +424,7 @@ ul {
.vscode-dark & {
background-color: var(--color-background--lighten-10);
}

.vscode-light & {
background-color: var(--color-background--darken-10);
}
Expand Down Expand Up @@ -436,6 +455,7 @@ ul {
right: var(--gitlens-scrollbar-gutter-width);
bottom: 0.5rem;
}

background-color: var(--vscode-sideBar-background);
}

Expand Down Expand Up @@ -480,7 +500,6 @@ ul {
flex: 1;
margin: 0;
display: block;

overflow-y: auto;
overflow-x: hidden;
max-height: 9rem;
Expand All @@ -500,6 +519,7 @@ ul {
flex-basis: 100%;
padding-top: 0.5rem;
}

&__author {
& + & {
margin-top: 0.5rem;
Expand All @@ -512,13 +532,16 @@ ul {
> :first-child {
margin-top: 0;
}

> :last-child {
margin-top: 0.5rem;
margin-bottom: 0;
}
}

&__pull-request {
}

&__issue {
> :not(:first-child) {
margin-top: 0.5rem;
Expand All @@ -533,9 +556,11 @@ ul {
top: 1px;
bottom: 1px;
}

line-height: 22px;
height: 22px;
}

&__item-skeleton {
padding: {
left: var(--gitlens-gutter-width);
Expand Down
17 changes: 14 additions & 3 deletions src/webviews/apps/home/home.scss
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,9 @@ body {
padding: 0.2rem 0.4rem;
background-color: var(--color-view-background);
}

.sr-only,
.sr-only-focusable:not(:active):not(:focus) {
.sr-only-focusable:not(:active, :focus) {
clip: rect(0 0 0 0);
clip-path: inset(50%);
width: 1px;
Expand All @@ -138,11 +139,11 @@ body {
display: none;
}
}

&__main {
flex: 1;
overflow: auto;
padding: 2rem 2rem 0.4rem;

background: linear-gradient(var(--color-view-background) 33%, var(--color-view-background)),
linear-gradient(var(--color-view-background), var(--color-view-background) 66%) 0 100%,
linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)),
Expand All @@ -152,6 +153,7 @@ body {
background-attachment: local, local, scroll, scroll;
background-size: 100% 12px, 100% 12px, 100% 6px, 100% 6px;
}

&__nav {
flex: none;
padding: 0 2rem;
Expand All @@ -168,7 +170,6 @@ body {
max-width: 30rem;
padding: 0.8rem 1.2rem 1.2rem;
z-index: 10;

display: flex;
flex-direction: column;
gap: 0.4rem;
Expand Down Expand Up @@ -299,6 +300,7 @@ ul {
align-items: center;
width: 2.2rem;
height: 2.2rem;

// line-height: 2.2rem;
color: inherit;
border-radius: 0.3rem;
Expand All @@ -314,6 +316,7 @@ ul {
.vscode-dark & {
background-color: var(--color-background--lighten-10);
}

.vscode-light & {
background-color: var(--color-background--darken-10);
}
Expand All @@ -332,6 +335,7 @@ ul {
left: 0.3rem;
right: 0.3rem;
}

gap: 0.2rem;
min-width: 2.2rem;
width: fit-content;
Expand Down Expand Up @@ -453,6 +457,7 @@ ul {
left: 0.5rem;
width: 4.6rem;
height: 3.2rem;

// background-color: #ff000066;

&:first-of-type {
Expand Down Expand Up @@ -560,6 +565,7 @@ vscode-button {
.mb-1 {
margin-bottom: 0.4rem;
}

.mb-0 {
margin-bottom: 0;
}
Expand Down Expand Up @@ -606,19 +612,24 @@ vscode-button {

&__indicator {
fill: transparent;

&.is-active {
fill: var(--vscode-activityBar-activeBorder);
}
}

&__icon {
transition: all ease 100ms;
fill: var(--vscode-activityBar-inactiveForeground);

&.is-active {
fill: var(--vscode-activityBar-foreground);
}
}

&__arrow {
fill: transparent;

&.is-active {
fill: var(--vscode-textLink-foreground);
}
Expand Down
Loading