Skip to content

Commit

Permalink
Fix loading custom properties into Tinymce skin
Browse files Browse the repository at this point in the history
For the Tinymce skin we need our custom properties available.
We cannot simply compile them into the skin, because it gets
loaded from Tinymce into the current document and this would
lead to duplicated custom properties.

So instead we compile it as separate file and include it in the
Alchemy admin as first stylesheet. This has the additional advantage
that we can load this file into ie. Solidus to display the Alchemy
Tinymce skin as well.
  • Loading branch information
tvdeyen committed Oct 15, 2024
1 parent 5051586 commit 843f615
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/assets/builds/alchemy/admin.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/assets/builds/alchemy/admin.css.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions app/assets/builds/alchemy/custom-properties.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/assets/builds/alchemy/custom-properties.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion app/assets/builds/alchemy/welcome.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/assets/builds/alchemy/welcome.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion app/assets/stylesheets/alchemy/admin.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@import "alchemy/custom-properties";
@import "alchemy/defaults";
@import "alchemy/fonts";
@import "alchemy/admin/archive";
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/alchemy/admin.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<meta name="alchemy-icon-sprite" content="<%= asset_path("remixicon.symbol.svg") %>">
<meta name="turbo-prefetch" content="false">
<meta name="turbo-cache-control" content="no-cache">
<%= stylesheet_link_tag('alchemy/custom-properties', media: 'screen', 'data-turbo-track' => true) %>
<%= stylesheet_link_tag('alchemy/admin', media: 'screen', 'data-turbo-track' => true) %>
<%= stylesheet_link_tag('alchemy/admin/print', media: 'print', 'data-turbo-track' => true) %>
<%= stylesheet_link_tag('alchemy/admin/custom', 'data-turbo-track' => true) %>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"lint": "prettier --check 'app/javascript/**/*.js'",
"eslint": "eslint app/javascript/**/*.js",
"build:js": "rollup -c",
"build:css": "sass --style=compressed --source-map --load-path app/assets/stylesheets --load-path vendor/assets/stylesheets app/assets/stylesheets/alchemy/admin.scss:app/assets/builds/alchemy/admin.css app/assets/stylesheets/alchemy/admin/print.scss:app/assets/builds/alchemy/admin/print.css app/assets/stylesheets/alchemy/welcome.scss:app/assets/builds/alchemy/welcome.css app/assets/stylesheets/tinymce/skins/content/alchemy/content.scss:app/assets/builds/tinymce/skins/content/alchemy/content.min.css app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.scss:app/assets/builds/tinymce/skins/ui/alchemy/skin.min.css app/assets/stylesheets/alchemy/admin/page-select.scss:app/assets/builds/alchemy/admin/page-select.css",
"build:css": "sass --style=compressed --source-map --load-path app/assets/stylesheets --load-path vendor/assets/stylesheets app/assets/stylesheets/alchemy/admin.scss:app/assets/builds/alchemy/admin.css app/assets/stylesheets/alchemy/admin/print.scss:app/assets/builds/alchemy/admin/print.css app/assets/stylesheets/alchemy/welcome.scss:app/assets/builds/alchemy/welcome.css app/assets/stylesheets/tinymce/skins/content/alchemy/content.scss:app/assets/builds/tinymce/skins/content/alchemy/content.min.css app/assets/stylesheets/tinymce/skins/ui/alchemy/skin.scss:app/assets/builds/tinymce/skins/ui/alchemy/skin.min.css app/assets/stylesheets/alchemy/admin/page-select.scss:app/assets/builds/alchemy/admin/page-select.css app/assets/stylesheets/alchemy/custom-properties.css:app/assets/builds/alchemy/custom-properties.css",
"build": "bun run --bun build:js && bun run --bun build:css"
},
"keywords": [],
Expand Down

0 comments on commit 843f615

Please sign in to comment.