Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CSS content support - Fixes #319 #324

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Muffinman
Copy link

@DannyvdSluijs for your approval.

@Muffinman
Copy link
Author

Note this is probably a major breaking change since I changed the params sent into CssInlinerPlugin constructor.

Copy link
Collaborator

@DannyvdSluijs DannyvdSluijs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great already! I have one concern regarding the loading of the CSS.
In general I think the README could use a small update to explain the different was of including CSS as the css-content config you introduced might be valuable for others as well. Do you think you can pick that up?

{
$filesToInline = $this->config['css-files'] ?? [];

$this->cssToAlwaysInclude = $this->loadCssFromFiles($filesToInline);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If both functions are used to add to the $this->cssToAlwaysInclude perhaps it would be best to also use the .= here as then the order of method calling has no side effects.

Suggested change
$this->cssToAlwaysInclude = $this->loadCssFromFiles($filesToInline);
$this->cssToAlwaysInclude .= $this->loadCssFromFiles($filesToInline);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants