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

[Feature Request] Option to disable automatic injection of CSS styles #158

Open
tomalexhughes opened this issue Apr 12, 2018 · 0 comments
Open

Comments

@tomalexhughes
Copy link

tomalexhughes commented Apr 12, 2018

Currently CSS is injected automatically via a tag inserted into the DOM.

It's also worth noting that the CSS is bundled by default, so there's no need to include any stylesheets to use the default theme. It's dyamically inserted before any other elements (like) stylesheets so it's super easy to override with your own styles.

This can be prevented with an empty link tag in the DOM, like below:

link(rel="stylesheet" id="alertifyCSS")

Whilst this works as expected to me it feels unsemantic to provide an empty link tag that is not actually doing anything.

Instead I think it would be a better option to provide an option to alertify that can prevent this injection from happening without having an empty link tag in the DOM. The benefit of this is that styles can be imported and bundled in the users build process via a module bundler such as Webpack if desired without cluttering the DOM. The link tag would still be the default behaviour unless otherwise specified.

Expected behavior

Link tag is automatically inserted into the DOM by default.
User can specify an option/call a method that prevents this from happening completely.

Actual behavior

Link tag is injected into the DOM unless it already exists.

Steps to reproduce the behavior

Import and run the module.

Version of Alertify in use

1.0.12

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

No branches or pull requests

1 participant