-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Replace Less with CSS #23481
Replace Less with CSS #23481
Conversation
Thanks, it's a big step toward supporting dynamic themes. |
If this PR would be merged sooner or later, I suggest to merge it ASAP to avoid other PRs conflict with this one. And it's better to kindly remind other PR (which conflicts) authors to pay attention to this change, and kindly thanks them for resolving conflicts manually, or maintainers do the help to resolve the conflicts. |
The |
I like |
And I am almost tempted to say that we should also backport this PR. |
I guess many styles are different between 1.19 and 1.20, so a cherry-pick backport won't work. If we want to have this in 1.19, just do the same thing on 1.19 branch separately. |
Sure, we can keep it. Both formats are fine with current lint config since stylelint had deprecated all their stylistic rules. |
Maybe not a good idea. I believe after this merged, some places may need to adjust. For 1.19, it's almost stable and should not have big frontend changes. Frontend bug could have a manual backport? |
Yes, this is very likely to introduce a bug or two, so probably should not backport right away at least. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I'm interested in how many bugs this will introduce as seen above.
However, if this PR should ever get merged, it must basically be merged ASAP, so I'm approving for now, even though there are open comments.
I've skimmed over it (I reviewed especially the files were GitHub showed that it was renamed in detail), I probably missed a lot for the completely new files
Fixed all remaining issues as well as comments that were misplaced by either lessc or prettier. I agree, we should land rather sooner than later because of merge conflict risk. |
* giteaofficial/main: (33 commits) Bump webpack from 5.75.0 to 5.76.0 (go-gitea#23484) Replace Less with CSS (go-gitea#23481) Fix 'View File' button in code search (go-gitea#23478) Use `gitea/test_env` image instead of `golang` (go-gitea#23455) Skip DB tests duplicate runs on push to branches (go-gitea#23476) Update app.example.ini (go-gitea#23480) [skip ci] Updated translations via Crowdin Fix due date being wrong on issue list (go-gitea#23475) test_env: hardcode major go version in use (go-gitea#23464) Push option bonus for PTC docs (go-gitea#23473) Lint Markdown pass Push to create docs (go-gitea#23458) Convert GitHub event on actions and fix some pull_request events. (go-gitea#23037) Remove wrongly added column on migration test fixtures (go-gitea#23456) Refactor branch/tag selector to Vue SFC (go-gitea#23421) add admin API email endpoints (go-gitea#22792) add user rename endpoint to admin api (go-gitea#22789) Add workflow error notification in ui (go-gitea#23404) Make branches list page operations remember current page (go-gitea#23420) fix markdown lint issue (go-gitea#23457) ...
Fix regression from go-gitea#23481. The conditional CSS import was being stripped away by webpack's `css-loader`, resulting in the dark theme always loading. Unfortunately, we have to re-introduce postcss to the CSS pipeline to fix this and I loaded only the minimal plugins to make it work. Related: webpack-contrib/css-loader#1503
Fix regression from #23481. The conditional on the CSS import was being stripped away by webpack's `css-loader`, resulting in the dark theme always loading. The old syntax with `@import` nested inside `@media` also did not work as `css-loader` (rightfully) ignores such non-standard `@import` syntax that was previously supported by Less. Unfortunately, we have to re-introduce postcss to the CSS pipeline to fix this and I loaded only the minimal plugins to make it work. There is one variant of the fix that does work without postcss, which is to exclude the file from transpilation but I did not consider it as it would have meant the `@import` was being done without a version suffix in the URL, which would have caused cache issue. Related: webpack-contrib/css-loader#1503 --------- Co-authored-by: John Olheiser <john.olheiser@gmail.com>
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: go-gitea#15565
Fix regression from go-gitea#23481. The conditional on the CSS import was being stripped away by webpack's `css-loader`, resulting in the dark theme always loading. The old syntax with `@import` nested inside `@media` also did not work as `css-loader` (rightfully) ignores such non-standard `@import` syntax that was previously supported by Less. Unfortunately, we have to re-introduce postcss to the CSS pipeline to fix this and I loaded only the minimal plugins to make it work. There is one variant of the fix that does work without postcss, which is to exclude the file from transpilation but I did not consider it as it would have meant the `@import` was being done without a version suffix in the URL, which would have caused cache issue. Related: webpack-contrib/css-loader#1503 --------- Co-authored-by: John Olheiser <john.olheiser@gmail.com>
Backport #23481, #23504 and #23520 to 1.19, just so we have an easier time with future backports. Seems to work on a basic level. There was a merge conflict in `RepoActionView.vue`, otherwise it merged cleanly. --------- Co-authored-by: John Olheiser <john.olheiser@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
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