Skip to content

Commit

Permalink
Try to fix the paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Jan 9, 2025
1 parent ec937f5 commit 68d50b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion app/assets/stylesheets/pdf.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
Expand Down
8 changes: 7 additions & 1 deletion config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 68d50b2

Please sign in to comment.