When using a starterkit (subtheme) [theme_root]/less/bootstrap.less
is used to compile the various bootstrap-specific less into the theme's css. However, some of the ordering there appears to differ from what's recommended in [bootstrap_root]/less/bootstrap.less
. Specifically glyphicons.less
is loaded as a "component" as opposed to a "reset". I suppose that "component" vs "reset" is a matter of semantics, but the end results that glyphicons.less
gets loaded too late.
A practical error situation is when styles from .form-control-feedback try to override styles from .glyphicon. This is the case on the password input widget (such as on the Drupal registration form). The glyph span used there contains both form-control-feedback and glyphicon classes, and it seems that the intent is for styles from .form-control-feedback to specifically override .glyphicon. Of course this does not happen as the .glyphicon styles are defined after .form-control-feedback styles. The end result is shown in the attachment:
The ordering is easy to fix on a local subtheme, but this should probably also be addressed in the starterkit itself.
Comment | File | Size | Author |
---|---|---|---|
#4 | bootstrap-starterkit_incorrect_less_include_order-2646988-4.patch | 1.26 KB | rjacobs |
Comments
Comment #2
rjacobs CreditAttribution: rjacobs at Center for Research Libraries commentedHere's a quick patch.
Comment #3
markhalliwellActually, I would surmise the entire file should be updated to reflect the same order as https://github.com/twbs/bootstrap/blob/v3.3.5/less/bootstrap.less
Comment #4
rjacobs CreditAttribution: rjacobs at Center for Research Libraries commentedFair enough. The only other change I could see was the addition of responsive-embed.less, which relates to #2428883: .embed-responsive-item class doesn’t work on sub-theme. I also matched the comments.
I'm assuming you are not also suggestion that the handling of variable-overrides.less be changed (the only real remaining difference)?
Comment #5
rjacobs CreditAttribution: rjacobs at Center for Research Libraries commentedJust wanted to check back on this. Is there anything else I can pass on or test?
Comment #6
mstrelan CreditAttribution: mstrelan commentedCan we get this in D8 as well? Specifically the responsive-embed.less include?
Comment #7
rjacobs CreditAttribution: rjacobs at Center for Research Libraries commentedThe patch from #4 appears to be completely interchangeable across 7.x-3.x and 8.x-3.x.
I'm changing the issue version to 8.x-3.x based on the assumption that this project uses a backport strategy.
Comment #10
markhalliwell