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 window.ZeroMdCssUrls hook for default CSS #12

Closed
wants to merge 1 commit into from

Conversation

bennypowers
Copy link

@bennypowers bennypowers commented Apr 6, 2019

Problem:

There's no current way to set a default theme. You end up having to copy/paste css-urls="['my-theme.css']" in to every instance of the element

Proposed Solution

Expose an optional ZeroMdCssUrls hook on the window object

Some Possible Objections

Pollutes window, but then again, there's already ZeroMdStore

Alternative Solutions

default to a shipped file, (i.e. 'zero-md/defualt-theme.css') tell users to overwrite that file

@zerodevx
Copy link
Owner

zerodevx commented Apr 7, 2019

Thanks for the PR! Agree that some mechanism should be exposed to allow global settings. Let me take a look and get back to you.

@zerodevx
Copy link
Owner

@bennypowers Thanks again for the PR - I thought it makes sense to expose all configurations (not just css-urls) through the ZeroMd.config hook instead.

This also gives the opportunity to refactor ZeroMdStore into ZeroMd.cache - so that all zero-mdish can be encapsulated inside the ZeroMd global.

Hopefully this fits your requirements!

@bennypowers
Copy link
Author

LGTM
Closing in favour of #14

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

Successfully merging this pull request may close these issues.

2 participants