Comments (8)
Ahh I see, you could try putting the css for one of the other themes under like humane.humane-info
in original.css
(and use humane.info to get that theme), if that makes sense. A little bit of a hack as the API doesn't currently support what you are asking in a simple way.
from humane-js.
So I'd essentially be splicing two themes together in to a custom theme which utilizes one theme style with 'info' / 'log' type and the other with the 'error' / 'success' type?
That could work, though I've found that the jackedup seems to be a nice combination of bold and unobtrusive, I kind of like it everywhere right now. I can still foresee instances where I may want to split out multiple themes.
Have you thought about allowing users to add a class attribute in the humane.create() builder function? That way one could create an error like:
var error = humane.create({ type: 'error', class: 'fatal', waitForMove: true, });
error('Yikes');
Which would add a .humane-fatal class instead of the .humane-error? ... Actually, I just checked through your code and I'm wondering if you couldn't just do that by adding your own 'type'? It seems like you may only actually using the type to append on to the humane- className and to fire custom events.
So you might actually be able to extend an existing theme pretty easily with the existing codebase which would also come with it's own custom events to handle a 'fatal' error type differently from a regular 'error' type, as well as giving it a slightly different skin. I still think there might be some value to adding additional custom event and class options so you could extend 'error' type in to 'fatal' and still get an onerror event along with the onfatal, but correct me if I'm wrong, it seems like just the custom type extension would work with minimal updates... what do you think?
from humane-js.
correct, you could use type and put whatever you want in it as long as you make a humane-type class, but again your base css gets inherited so you may want need to pull some of that out and put it in the subclasses so both themes work
from humane-js.
yeah class and type are sorta the same thing when creating, since it looks for a class called 'humane-{type}'
from humane-js.
Awesome, it can still serve the function of extending the given themes so that you can have yellow, orange, red, or black for progressive levels of error/notification by just adding a few more style rules and creating the custom notifiers.
The documentation makes the humane.create() seem like it can only be used for currying a custom function from existing static types, when in reality you can get pretty creative depending on what you're trying to do. I think I could easily go back to using the original style, add a single .humane-autosave rule which changes the top, font-size, min-height and width to be less obtrusive and utilize that custom notifier for that specific case.
You should think about updating the Custom Notifier section of the docs to let people know it's more flexible than they may realize. Awesome work, btw, simple, light and unassuming.. I'm thinking of using it as a model for a humane-like tooltip plugin for handling notifications which are specific to an element or location on the page.
from humane-js.
yeah should update the docs (I honestly wasn't sure how many would try what you are doing but its totally doable)... my goal is simplicity, I almost want to gut out the standard humane.info|error|log|success and just have humane and humane.create (where you can roll your own). humane.create came after the others.
from humane-js.
Yeah, that's a good idea, the docs would be way simpler and much more accurate if you focused on the humane.create function as the core from which you can roll any number of notifications and make the built-in notifications a footnote.
Though if you removed them completely the themes would be kind of bland. You could use them as examples of the ease with which you can extend the base themes and notifications with 1 line of js and 1 css rule though.
from humane-js.
this is implemented per 3.0.0 release
from humane-js.
Related Issues (20)
- Stacking of notifications HOT 2
- Limiting number of pending notifications HOT 1
- fatty theme not on bower HOT 2
- Indicator count for queued notifications HOT 3
- css styling in messages HOT 1
- Missing semicolon at the end of the non-minified source HOT 2
- bower install humane-js does not reflect #master HOT 4
- remove before log (or error/info/etc) together option HOT 2
- Humane stylesheet displays scrollbars when it shouldn't HOT 2
- Option to manually attach humane div. HOT 2
- Humane.js Customize Style
- please add links to cdn to README HOT 1
- custom html markup HOT 1
- Adding hyperlinks to notification? HOT 2
- Add unit tests HOT 1
- Support for confirm and alert custom dialog HOT 1
- Is there a way to get a clicked element in the callback?
- Text doesnt feed to notification
- Use new syntax of linear-gradient HOT 5
- how do you "stack" the notifications? getting overlapped one over the other HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from humane-js.