Skip to content

Commit

Permalink
✨ Add tighter (S)CSS integration
Browse files Browse the repository at this point in the history
* Add `Alchemy#extractCSSExport(css_path)`
* Implement custom SCSS importer logic
* Add `Alchemy#registerRequiredStylesheet(css_path)` and add it to the virtual "alchemy" SCSS module
  • Loading branch information
skerit committed Feb 23, 2024
1 parent ce76952 commit 9d60703
Show file tree
Hide file tree
Showing 4 changed files with 392 additions and 61 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## 1.4.0-alpha.3 (WIP)

* Also define the shared constants as globals in Hawkejs templates
* Add `Alchemy#extractCSSExport(css_path)`
* Implement custom SCSS importer logic
* Add `Alchemy#registerRequiredStylesheet(css_path)` and add it to the virtual "alchemy" SCSS module

## 1.4.0-alpha.2 (2024-02-19)

Expand Down
16 changes: 16 additions & 0 deletions lib/class/element.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@
*/
const Element = Function.inherits('Hawkejs.Element', 'Alchemy.Element', 'Element');

/**
* Let Alchemy handle the stylesheets of custom elements
*
* @author Jelle De Loecker <jelle@elevenways.be>
* @since 1.4.0
* @version 1.4.0
*/
Element.setStylesheetHandler(function handleStylesheet(path) {

if (!path || Blast.isBrowser) {
return;
}

alchemy.registerRequiredStylesheet(path);
});

/**
* The default element prefix (when element contains no hyphen) is "al"
*
Expand Down
Loading

0 comments on commit 9d60703

Please sign in to comment.