_form.scss has CSS like this

.form-required:after {
  background-image: url(../images/required.svg);

This only works if the SASS is compiled to a CSS file in a first level sub-directory of the theme, like my_theme/sub_dir/compiled.css. In my case, the compiled CSS is in public://my_theme (this is to allow multiple sites to share a single theme but with minor variations in SCSS variables based on settings such as colors).

True, for the moment there is only one occurrence so it's not too hard for me to handle it by adding this CSS override

.form-required:after {
  background-image: url(/themes/my_theme/images/required.svg);
}

However my code can go out of date if the underlying theme code changes. The base bootstrap files avoid a similar problem by means of $icon-font-path. Might we be able to do something similar here to be more robust for the future?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

AdamPS created an issue. See original summary.

markhalliwell’s picture

Makes sense, would be a good thing to have in cases like this.

AdamPS’s picture

Status: Active » Needs review
FileSize
2.26 KB

Here is a patch, but beware that I am not very sure about the starter kits, and I don't use less.

markhalliwell’s picture

Status: Needs review » Needs work
+++ b/starterkits/sass/scss/_default-variables.scss
@@ -10,5 +10,8 @@
+$theme-root: '..';

This is fine, but I think there should also be an $image-path variable as well.

AdamPS’s picture

Status: Needs work » Needs review
FileSize
2.42 KB
1.87 KB

Good idea

markhalliwell’s picture

Status: Needs review » Fixed

  • markcarver committed b6d3a5d on 8.x-3.x authored by AdamPS
    Issue #3014107 by AdamPS: Allow control of relative path to required.svg
    
AdamPS’s picture

Great thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.