Replace Less with CSS (#23481)

Ran most of the Less files through the Less compiler and Prettier and
then followed up with a round of manual fixes.

The Less compiler had unfortunately stripped all `//` style comments
that I had to restore (It did preserve `/* */` comments). Other fixes
include duplicate selector removal which were revealed after the
transpilation and which weren't caught by stylelint before but now are.

Fixes: https://github.com/go-gitea/gitea/issues/15565
This commit is contained in:
silverwind 2023-03-15 03:20:19 +01:00 committed by GitHub
parent bf730528ca
commit 202803fc69
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
73 changed files with 8215 additions and 7777 deletions

View file

@ -21,7 +21,7 @@ const glob = (pattern) => fastGlob.sync(pattern, {
});
const themes = {};
for (const path of glob('web_src/less/themes/*.less')) {
for (const path of glob('web_src/css/themes/*.css')) {
themes[parse(path).name] = [path];
}
@ -57,14 +57,14 @@ export default {
fileURLToPath(new URL('web_src/js/index.js', import.meta.url)),
fileURLToPath(new URL('node_modules/easymde/dist/easymde.min.css', import.meta.url)),
fileURLToPath(new URL('web_src/fomantic/build/semantic.css', import.meta.url)),
fileURLToPath(new URL('web_src/less/index.less', import.meta.url)),
fileURLToPath(new URL('web_src/css/index.css', import.meta.url)),
],
webcomponents: [
fileURLToPath(new URL('web_src/js/webcomponents/GiteaOriginUrl.js', import.meta.url)),
],
swagger: [
fileURLToPath(new URL('web_src/js/standalone/swagger.js', import.meta.url)),
fileURLToPath(new URL('web_src/less/standalone/swagger.less', import.meta.url)),
fileURLToPath(new URL('web_src/css/standalone/swagger.css', import.meta.url)),
],
serviceworker: [
fileURLToPath(new URL('web_src/js/serviceworker.js', import.meta.url)),
@ -136,7 +136,7 @@ export default {
],
},
{
test: /.css$/i,
test: /\.css$/i,
use: [
{
loader: MiniCssExtractPlugin.loader,
@ -151,29 +151,6 @@ export default {
},
],
},
{
test: /.less$/i,
use: [
{
loader: MiniCssExtractPlugin.loader,
},
{
loader: 'css-loader',
options: {
sourceMap: true,
importLoaders: 1,
url: {filter: filterCssImport},
import: {filter: filterCssImport},
},
},
{
loader: 'less-loader',
options: {
sourceMap: true,
},
},
],
},
{
test: /\.svg$/,
include: fileURLToPath(new URL('public/img/svg', import.meta.url)),