Skip to content
This repository has been archived by the owner on Oct 13, 2018. It is now read-only.

Extend notify styles instead of replacing #26

Closed
joemaller opened this issue Oct 17, 2015 · 3 comments
Closed

Extend notify styles instead of replacing #26

joemaller opened this issue Oct 17, 2015 · 3 comments

Comments

@joemaller
Copy link
Contributor

BrowserSync/browser-sync#685 shows how to override the styles on the in-browser notify div in lib/notify.js, but changing any single rule requires replicating the entire styles array.

It would be nice if we could override a single style rule. For example, only changing the background color, font-size or positioning.

Also, would it be ok to add a Lodash dependency to help streamline this?

@shakyShane
Copy link
Contributor

If you're planning on implementing this, I'd say it's simple enough to not need an external lib. Just change from an array to an object and do a simple key loop?

@joemaller
Copy link
Contributor Author

Yeah, the library request was just laziness. 😴

I spent a little extra time to make sure existing whole-array behavior still works if options.notify.styles is an array. If it gets an object, all properties of the object are merged onto the default styles object. There are tests for both behaviors.

@shakyShane
Copy link
Contributor

fixed via #27

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

No branches or pull requests

2 participants