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

Bootstrap is included twice in evap.css #2362

Open
niklasmohrin opened this issue Jan 6, 2025 · 2 comments · May be fixed by #2365
Open

Bootstrap is included twice in evap.css #2362

niklasmohrin opened this issue Jan 6, 2025 · 2 comments · May be fixed by #2365
Assignees
Labels
[C] Infrastructure Infrastructural work around the main EvaP project [T] Bug This is a bug. We don't like it. Please get rid of it.

Comments

@niklasmohrin
Copy link
Member

When I open evap.css (on the development branch, or on production), I see the following (with long lines truncated):

/*!
 * Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com
 * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
 * Copyright 2024 Fonticons, Inc.
 */.fa{font-family:var(--fa-style-family, "Font Awesome 6 Free");font-weight:var(--fa-style, 900)}.fa-solid,.fa-regular,.fa-brands,.fas,.far,.fab,.fa-
 * Bootstrap  v5.3.0-alpha1 (https://getbootstrap.com/)
 * Copyright 2011-2022 The Bootstrap Authors
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 */:root,[data-bs-theme=light]{--bs-blue: #0d6efd;--bs-indigo: #6610f2;--bs-purple: #6f42c1;--bs-pink: #d63384;--bs-red: #dc3545;--bs-orange: #fd7e14;
 * Bootstrap  v5.3.0-alpha1 (https://getbootstrap.com/)
 * Copyright 2011-2022 The Bootstrap Authors
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 */:root,[data-bs-theme=light]{--bs-blue: #0d6efd;--bs-indigo: #6610f2;--bs-purple: #6f42c1;--bs-pink: #d63384;--bs-red: #dc3545;--bs-orange: #fd7e14;

It seems like we include two copies of bootstrap. Some initial observations:

  • The two lines start out the same and still look the same at column 78390 (where the font-awesome line ends).
  • At column 226300 (where the first bootstrap line ends), the two lines are already different.
  • The first occurrence of "evap" in the file is in the last line at column 228691.
@niklasmohrin niklasmohrin added [T] Bug This is a bug. We don't like it. Please get rid of it. [C] Infrastructure Infrastructural work around the main EvaP project labels Jan 6, 2025
@niklasmohrin
Copy link
Member Author

By adding @warn("foo"); to evap/static/bootstrap/scss/_root.scss, I get

Warning: foo
    evap/static/bootstrap/scss/_root.scss 12:3  @import
    evap/static/scss/_bootstrap.scss 12:9       @import
    evap/static/scss/evap.scss 5:9              root stylesheet

Warning: foo
    evap/static/bootstrap/scss/_root.scss 12:3     @import
    evap/static/scss/_bootstrap.scss 12:9          @import
    evap/static/scss/components/_buttons.scss 1:9  @import
    evap/static/scss/_components.scss 5:9          @import
    evap/static/scss/evap.scss 6:9                 root stylesheet

The duplicate import was added in #1771, so I suppose we can just remove it again. Will test later

@niklasmohrin niklasmohrin self-assigned this Jan 13, 2025
@niklasmohrin niklasmohrin linked a pull request Jan 13, 2025 that will close this issue
@niklasmohrin
Copy link
Member Author

From https://sass-lang.com/documentation/at-rules/import/ :

As of Dart Sass 1.80.0, the @import rule is deprecated and will be removed from the language in Dart Sass 3.0.0. Prefer the @use rule instead.

The use system is more like a module system like the one in Python, for example

@use only ever loads each file once. This ensures you don’t end up accidentally duplicating your dependencies’ CSS many times over.

So it would be a worthwhile change, probably. @janno42 and I briefly discussed whether or not we actually still need SCSS at all. Many of the originally motivating features like imports, variables, nesting have made their way onto CSS by now, and bootstrap seems to use more CSS variables nowadays. We concluded that it's still nice to have SCSS for the loops etc. Also note that the SCSS tutorial for bootstrap still shows @import instead of @use. It seems that they will switch at bootstrap 6, but who knows (https://stackoverflow.com/a/78786407/13679671).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Infrastructure Infrastructural work around the main EvaP project [T] Bug This is a bug. We don't like it. Please get rid of it.
Development

Successfully merging a pull request may close this issue.

1 participant