diff --git a/app/assets/stylesheets/pdf.css.scss b/app/assets/stylesheets/pdf.css.scss index 0459a97be99..6df65415f19 100644 --- a/app/assets/stylesheets/pdf.css.scss +++ b/app/assets/stylesheets/pdf.css.scss @@ -8,7 +8,10 @@ a { // We need the import here, otherwise Rails' asset adds a BOM at the beginning of it, // and the font doesn't get recognize! -@import "@cubing/icons"; /* stylelint-disable-line no-invalid-position-at-import-rule */ +// +// This refers to: `[repo root]/node_modules/@cubing/icons/dist/lib/@cubing/icons/cubing-icons.css`, +// per a configuration in `assets.rb`. +@import "cubing-icons"; /* stylelint-disable-line no-invalid-position-at-import-rule */ header { width: 100%; diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index 10499a8f0c4..275306ccc67 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -10,7 +10,13 @@ # helper! # wicked_pdf's helpers can't handle "packs_with_chunks" and therefore cannot # properly inline our packs :( -Rails.application.config.assets.paths << Rails.root.join("node_modules", "@cubing", "icons", "www", "css") +# +# Note: reaching into the package structure violates the semantics of package +# exports, which could theoretically turn any release of `@cubing/icons` into a +# breaking one. However, this path should be fairly stable, and the usage here +# should be safe as long as `@cubing/icons` is not bumped automatically without +# exercising this code path in a test. +Rails.application.config.assets.paths << Rails.root.join("node_modules", "@cubing", "icons", "dist", "lib", "@cubing", "icons") # Precompile additional assets. # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.