Skip to content

Commit 202803f

Browse files
authored
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: #15565
1 parent bf73052 commit 202803f

Some content is hidden

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

73 files changed

+8229
-7791
lines changed

Diff for: .stylelintrc.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ ignoreFiles:
55
- "**/*.go"
66

77
overrides:
8-
- files: ["**/*.less"]
9-
customSyntax: postcss-less
108
- files: ["**/chroma/*", "**/codemirror/*", "**/standalone/*", "**/console/*"]
119
rules:
1210
scale-unlimited/declaration-strict-value: null

Diff for: Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ GO_TEST_PACKAGES ?= $(filter-out $(shell $(GO) list code.gitea.io/gitea/models/m
105105

106106
FOMANTIC_WORK_DIR := web_src/fomantic
107107

108-
WEBPACK_SOURCES := $(shell find web_src/js web_src/less -type f)
108+
WEBPACK_SOURCES := $(shell find web_src/js web_src/css -type f)
109109
WEBPACK_CONFIGS := webpack.config.js
110110
WEBPACK_DEST := public/js/index.js public/css/index.css
111111
WEBPACK_DEST_ENTRIES := public/js public/css public/fonts public/img/webpack public/serviceworker.js
@@ -131,7 +131,7 @@ TEST_TAGS ?= sqlite sqlite_unlock_notify
131131
TAR_EXCLUDES := .git data indexers queues log node_modules $(EXECUTABLE) $(FOMANTIC_WORK_DIR)/node_modules $(DIST) $(MAKE_EVIDENCE_DIR) $(AIR_TMP_DIR) $(GO_LICENSE_TMP_DIR)
132132

133133
GO_DIRS := cmd tests models modules routers build services tools
134-
WEB_DIRS := web_src/js web_src/less
134+
WEB_DIRS := web_src/js web_src/css
135135

136136
GO_SOURCES := $(wildcard *.go)
137137
GO_SOURCES += $(shell find $(GO_DIRS) -type f -name "*.go" -not -path modules/options/bindata.go -not -path modules/public/bindata.go -not -path modules/templates/bindata.go)
@@ -342,7 +342,7 @@ lint: lint-frontend lint-backend
342342
.PHONY: lint-frontend
343343
lint-frontend: node_modules
344344
npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js docs/assets/js tests/e2e
345-
npx stylelint --color --max-warnings=0 web_src/less
345+
npx stylelint --color --max-warnings=0 web_src/css
346346
npx spectral lint -q -F hint $(SWAGGER_SPEC)
347347
npx markdownlint docs *.md
348348

Diff for: docs/content/doc/advanced/customizing-gitea.en-us.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ To make a custom theme available to all users:
354354
355355
Community themes are listed in [gitea/awesome-gitea#themes](https://gitea.com/gitea/awesome-gitea#themes).
356356
357-
The `arc-green` theme source can be found [here](https://github.com/go-gitea/gitea/blob/main/web_src/less/themes/theme-arc-green.less).
357+
The `arc-green` theme source can be found [here](https://github.com/go-gitea/gitea/blob/main/web_src/css/themes/theme-arc-green.css).
358358
359359
If your custom theme is considered a dark theme, set the global css variable `--is-dark-theme` to `true`.
360360
This allows Gitea to adjust the Monaco code editor's theme accordingly.

Diff for: docs/content/doc/developers/guidelines-frontend.en-us.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ menu:
2121

2222
## Background
2323

24-
Gitea uses [Less CSS](https://lesscss.org), [Fomantic-UI](https://fomantic-ui.com/introduction/getting-started.html) (based on [jQuery](https://api.jquery.com)) and [Vue3](https://vuejs.org/) for its frontend.
24+
Gitea uses [Fomantic-UI](https://fomantic-ui.com/introduction/getting-started.html) (based on [jQuery](https://api.jquery.com)) and [Vue3](https://vuejs.org/) for its frontend.
2525

2626
The HTML pages are rendered by [Go HTML Template](https://pkg.go.dev/html/template).
2727

2828
The source files can be found in the following directories:
2929

30-
* **Less styles:** `web_src/less/`
30+
* **CSS styles:** `web_src/css/`
3131
* **JavaScript files:** `web_src/js/`
3232
* **Vue components:** `web_src/js/components/`
3333
* **Go HTML templates:** `templates/`

0 commit comments

Comments
 (0)