Skip to content

Commit 8b2c040

Browse files
authored
Migrate LESS to SCSS (jenkinsci#7850)
1 parent 4aeb0eb commit 8b2c040

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+433
-397
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
root = true
22

3-
[*.{js, less, css, hbs}]
3+
[*.{js, scss, css, hbs}]
44
indent_style = space
55
indent_size = 2
66
trim_trailing_whitespace = true

war/.stylelintrc.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = {
22
extends: "stylelint-config-standard",
3-
customSyntax: "postcss-less",
3+
customSyntax: "postcss-scss",
4+
ignoreFiles: ["src/main/scss/pluginSetupWizard.less"],
45
rules: {
56
"no-descending-specificity": null,
67
"selector-class-pattern": "[a-z]",
@@ -15,6 +16,20 @@ module.exports = {
1516
],
1617
"property-no-vendor-prefix": null,
1718
"at-rule-no-vendor-prefix": null,
19+
"at-rule-no-unknown": [
20+
true,
21+
{
22+
ignoreAtRules: [
23+
"function",
24+
"if",
25+
"each",
26+
"include",
27+
"mixin",
28+
"for",
29+
"use",
30+
],
31+
},
32+
],
1833
"color-function-notation": "legacy",
1934
"alpha-value-notation": "number",
2035
"number-max-precision": 5,

war/package.json

+6-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
"start": "yarn dev --watch",
1717
"lint:js": "eslint --config .eslintrc.js ../ --ext js && prettier --check ../",
1818
"lint:js-ci": "eslint --config .eslintrc.js ../ --ext js -f checkstyle -o target/eslint-warnings.xml && prettier --check ../",
19-
"lint:css": "stylelint src/main/less",
20-
"lint:css-ci": "stylelint src/main/less --custom-formatter stylelint-checkstyle-reporter -o target/stylelint-warnings.xml",
19+
"lint:css": "stylelint src/main/scss",
20+
"lint:css-ci": "stylelint src/main/scss --custom-formatter stylelint-checkstyle-reporter -o target/stylelint-warnings.xml",
2121
"lint:ci": "yarn lint:js-ci && yarn lint:css-ci",
22-
"lint:fix": "prettier --write ../ && stylelint src/main/less --fix && eslint --config .eslintrc.js --fix ../",
22+
"lint:fix": "prettier --write ../ && stylelint src/main/scss --fix && eslint --config .eslintrc.js --fix ../",
2323
"lint": "yarn lint:js && yarn lint:css"
2424
},
2525
"devDependencies": {
@@ -39,9 +39,11 @@
3939
"less-loader": "11.1.0",
4040
"mini-css-extract-plugin": "2.7.5",
4141
"postcss": "8.4.21",
42-
"postcss-less": "6.0.0",
4342
"postcss-loader": "7.2.4",
43+
"postcss-scss": "4.0.6",
4444
"prettier": "2.8.7",
45+
"sass": "1.62.0",
46+
"sass-loader": "13.2.2",
4547
"style-loader": "3.3.2",
4648
"stylelint": "15.5.0",
4749
"stylelint-checkstyle-reporter": "0.2.0",

war/postcss.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-env node */
22
module.exports = {
3-
parser: "postcss-less",
3+
parser: "postcss-scss",
44
plugins: [require("autoprefixer")],
55
};

war/src/main/js/add-item.less

-12
This file was deleted.

war/src/main/js/add-item.scss

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@use "widgets/variables";
2+
3+
/*
4+
* Widget styles
5+
*/
6+
@use "widgets/add/addform";

war/src/main/js/widgets/add/addform.less war/src/main/js/widgets/add/addform.scss

-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@import "../../../less/abstracts/theme.less";
2-
31
#add-item-panel {
42
form > .header {
53
position: relative;
@@ -266,14 +264,7 @@
266264
border-color: var(--input-border);
267265
box-shadow: inset 999rem 0 var(--background);
268266
-webkit-touch-callout: text;
269-
-webkit-user-select: text;
270-
-khtml-user-select: text;
271-
-moz-user-select: text;
272-
-ms-user-select: text;
273267
user-select: text;
274-
-moz-transition: 0.5s;
275-
-webkit-transition: 0.5s;
276-
-o-transition: 0.5s;
277268
transition: 0.5s;
278269

279270
.icon {
@@ -283,10 +274,6 @@
283274

284275
li {
285276
-webkit-touch-callout: none;
286-
-webkit-user-select: none;
287-
-khtml-user-select: none;
288-
-moz-user-select: none;
289-
-ms-user-select: none;
290277
user-select: none;
291278
cursor: pointer;
292279
border: 1px solid transparent;

war/src/main/js/widgets/layout-mixins.less

-49
This file was deleted.

war/src/main/js/widgets/variables.less war/src/main/js/widgets/variables.scss

-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,3 @@
1414

1515
--input-line-height: 2.25em;
1616
}
17-
18-
@border-radius: 3px;

war/src/main/less/abstracts/colors.less

-40
This file was deleted.

war/src/main/less/base/spacing.less

-49
This file was deleted.

war/src/main/less/styles.less

-63
This file was deleted.
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
@use "theme";
2+
3+
// Generates a series of color override classes and their variations,
4+
// e.g. .jenkins-!-color-blue, .jenkins-!-color-light-blue, .jenkins-!-color-dark-blue
5+
@each $key, $value in theme.$colors {
6+
.jenkins-\!-color-light-#{$key} {
7+
--color: var(--light-#{$key});
8+
9+
color: var(--light-#{$key}) !important;
10+
}
11+
.jenkins-\!-color-#{$key} {
12+
--color: var(--#{$key});
13+
14+
color: var(--#{$key}) !important;
15+
}
16+
.jenkins-\!-color-dark-#{$key} {
17+
--color: var(--dark-#{$key});
18+
19+
color: var(--dark-#{$key}) !important;
20+
}
21+
}
22+
23+
@each $key, $value in theme.$semantics {
24+
.jenkins-\!-#{$key}-color {
25+
--color: #{$value};
26+
27+
color: #{$value} !important;
28+
}
29+
}
30+
31+
// Deprecated - don't use the below classes
32+
.greyed {
33+
color: #999;
34+
}
35+
36+
.redbold {
37+
color: var(--red);
38+
font-weight: bold;
39+
}
40+
41+
.greenbold {
42+
color: var(--green);
43+
font-weight: bold;
44+
}

0 commit comments

Comments
 (0)