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

Replace Less with CSS #23508

Merged
merged 6 commits into from
Mar 17, 2023
Merged

Commits on Mar 16, 2023

  1. Replace Less with CSS (go-gitea#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: go-gitea#15565
    silverwind committed Mar 16, 2023
    Configuration menu
    Copy the full SHA
    93528bd View commit details
    Browse the repository at this point in the history
  2. Fix theme-auto loading (go-gitea#23504)

    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>
    silverwind and jolheiser committed Mar 16, 2023
    Configuration menu
    Copy the full SHA
    e93d666 View commit details
    Browse the repository at this point in the history
  3. Fix merge

    silverwind committed Mar 16, 2023
    Configuration menu
    Copy the full SHA
    e4daca8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    17c96b9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3ba6a5a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ab2e030 View commit details
    Browse the repository at this point in the history