-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Select2 css width override #1032
Comments
Just noticed that it's there to override the default inline style added by |
Hi @phillmac! I want to contribute to this project. I tried to understand the problem statement. If I am correct, the default inline style added by |
In some cases 100% width is not desireable. |
If you look at the bottom of your screenshot there is a width 100% !important rule. My problem is with the presence of the !important making it hard to change. |
I agree to your point that we shouldn't have But can you please give me an example where we have set |
Thats exactly my point, the link you mentioned for the config option does not work because the !important takes precidence. I wanted to use an 8% width to fit the element inline with some text. I'll try and make some screenshots & example html |
It looks like that line was changed 3 years ago. The problem it was intended to fix may not be an issue anymore. Have you tried removing it to see what happens? |
UserFrosting/app/sprinkles/core/assets/userfrosting/css/userfrosting.css
Line 153 in a8e6711
The
!important
on this line makes it incredibly hard to dynamically set a smaller width. This CSS file has the most priority over the other standard included CSS files, so the !important is effectively redundant.E.g.
$(".select2-container").css("width", "8%")
doesn't work because the!important
overrides the inline style. It's almost impossible to add a !important with jQuery, see: https://bugs.jquery.com/ticket/11173To get around this problem, one has to resort to this sort of ugliness:
$(".select2-container")[0].style.setProperty("width", "8%", "important")
The text was updated successfully, but these errors were encountered: