Components are missing some custom SCSS stylesheets

Created on 31 August 2024, 4 months ago
Updated 19 September 2024, 3 months ago

Problem/Motivation

Component stylesheets (such as https://git.drupalcode.org/project/radix/-/blob/6.0.x/components/accordi...) currently include _init.scss (https://git.drupalcode.org/project/radix/-/blob/6.0.x/src/kits/radix_sta...). However, this excludes custom stylesheets, which are included in main.style.scss (https://git.drupalcode.org/project/radix/-/blob/6.0.x/src/kits/radix_sta...).

Proposed resolution

One way would be duplication of

@import "base/functions";
@import "base/helpers";

in every component (I believe that including of _elements.scss and _typography.scss stylesheets probably isn't needed). Perhaps there's a better way, though.

🐛 Bug report
Status

Fixed

Version

6.0

Component

Code

Created by

🇨🇿Czech Republic milos.kroulik

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @milos.kroulik
  • The ideal way would be to use @use instead of @import for sure but Bootstrap is not yet supporting that, hopefully in bootstrap 6.x

    on the other hand _init.scss contains the following:

    @import "~bootstrap/scss/functions";
    
    // Custom overrides
    @import "base/variables";
    
    // Required
    @import "~bootstrap/scss/variables";
    @import "~bootstrap/scss/variables-dark";
    @import "~bootstrap/scss/maps";
    @import "~bootstrap/scss/utilities";
    @import "~bootstrap/scss/mixins";
    @import "base/mixins";
    @import "base/utilities";
    
    // Optional if using rfs()
    @import "~bootstrap/scss/vendor/rfs";
    

    So that's not with _elements.scss or _typography.scss

    The main reason we are including init, is to make sure we have access to our variables, mixins and so on. It might not be ideal due to lack of @use but it can be just fine as is for now, you can always remove that manually.

    Unless you have a better suggestion, I think it is safe to keep it as is.

  • 🇨🇿Czech Republic milos.kroulik

    Perhaps we could import custom functions in _init-scss directly below @import "~bootstrap/scss/functions";? Looking at https://getbootstrap.com/docs/5.3/customize/sass/#importing I believe it should be fine. Helpres probably aren't needed, after all.

  • I suspect we should update the init, just noticed that we are not adding the root

    not sure if we can decide for each project what's needed or not. The idea is to ship with the features, people can opt-out and comment out what they don't need.

  • 🇨🇿Czech Republic milos.kroulik

    Should I create a MR?

  • definitely, I would appreciate it, thanks

  • Pushed an update Milos, thanks for bringing this up

  • Status changed to Fixed 3 months ago
    • doxigo committed b2039b09 on 6.0.x
      Issue #3471365 by milos.kroulik, doxigo: Components are missing some...
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024