understrap / understrap-child

The starter child theme for Understrap, the renowned open-source WordPress starter theme.
GNU General Public License v3.0
579 stars 330 forks source link

Feature/bs5 development -> src/sass/assets/bootstrap5/_functions.scss #314

Open braindunk opened 2 years ago

braindunk commented 2 years ago

An error which is referenced elsewhere online as related to older releases of BS 5 is occurring on every attempt to install Understrap Child with BS 5 enabled.

Sass Compiling Error custom-editor-style.scss "$color1: null is not a color.: assets/bootstrap5/mixins/_table-variants.scss on line 5, at column 5 Call Stack:

0 mixin table-variant assets/bootstrap5/_tables.scss on line 134

1 import assets/bootstrap5/_tables.scss custom-editor-style.scss on line 12"

child-theme.scss "$color1: null is not a color.: assets/bootstrap5/mixins/_table-variants.scss on line 5, at column 5 Call Stack:

0 mixin table-variant assets/bootstrap5/_tables.scss on line 134

1 import assets/bootstrap5/_tables.scss assets/bootstrap5/bootstrap.scss on line 22

2 import assets/bootstrap5/bootstrap.scss child-theme.scss on line 2

3 mixin table-variant assets/bootstrap5/_tables.scss on line 134

4 import assets/bootstrap5/_tables.scss custom-editor-style.scss on line 12"

bacoords commented 2 years ago

We don't use the variable $color1, so I'm wondering if there was an error with a find-and-replace or something else?

MicahSimmons commented 2 years ago

I was able to work around this issue by modifying color-contrast() in _functions.scss. contrast-ratio() seems to only ever return negative values, so max-ratio-color is left as null since the min/max ratio conditions are never satisfied. The "color1" error is coming from the SASS mix function in a subsequent call.

I tried changing $max-ratio-color from null to $color-contrast-light. I also tried multiplying the output of contrast-ratio() by -1. Either seem to avoid the stack dump.

bacoords commented 2 years ago

I would also check what version of Bootstrap 5 is being loaded in your package.json. If it's not the latest (5.1.3 at time of writing) you could upload it again, re-run the copy-assets command and try compiling again?

s7media commented 2 years ago

I'm having the same issue. Previously been deploying 1.0.1 with Bootstrap 4 and just started out on 1.1.0 on a brand new WP install.

s7media commented 2 years ago

I'm having the same issue. Previously been deploying 1.0.1 with Bootstrap 4 and just started out on 1.1.0 on a brand new WP install.

Quick update, after updating SCSSPHP 1.5 to 1.10 I don't have this issue anymore. I use the WPSCSS plugin and had to manually remove the old SCSSPHP folder and replace with the new one.