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

Custom Class Doesn't Work #147

Closed
teamayu opened this issue Apr 28, 2024 · 2 comments · Fixed by #148
Closed

Custom Class Doesn't Work #147

teamayu opened this issue Apr 28, 2024 · 2 comments · Fixed by #148
Labels

Comments

@teamayu
Copy link

teamayu commented Apr 28, 2024

Great little plugin, thank you.

In the docs it says:

"Assign a Custom CSS class to the bar. Overrides ALL styles passed as options. For e.g. padding, backgroundColor etc."

This doesn't actually work as default parameters still get passed in which overwrite any custom class.

var bar = $.peekABar({
html : 'Some message',
delay : 2000,
autohide : true,
animation : {
type : 'fade',
duration : '2000'
},
opacity : '0.8',
cssClass : 'bar-success',
position : 'bottom',
closeOnClick : true,
onShow : function() {},
onHide : function() {}
});
bar.show();

This what is displayed in the dev console:

<div class="peek-a-bar bar-success" id="__peek_a_bar_48236846" style="padding: 1em; background-color: rgb(195, 195, 195); opacity: 0.8; bottom: 0px; display: none;">Some message`

Padding and background are still applied as you are still setting them if the cssClass is not null. I updated the js code and it works fine now, but you may want to fix it. Inline styles overwrite the css.

@kunalnagar
Copy link
Member

@teamayu - thanks for bringing this up. It is definitely a documentation issue - I'll fix it soon 👍

Copy link

🎉 This issue has been resolved in version 3.6.22 🎉

The release is available on:

Your semantic-release bot 📦🚀

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 a pull request may close this issue.

2 participants