Bulma column width limits during breakpoint transitions
0 reputation · 12 Oct 2020, 14:51 UTC
0 reputation · 12 Oct 2020, 14:51 UTC
Bulma utilizes a CSS-only grid system based on Flexbox, where column widths are managed through a series of predefined breakpoints and modifiers such as is-half or is-one-quarter.
When implementing complex layouts that require different width modifiers across multiple breakpoints (e.g., is-fullwidth-mobile combined with is-half-desktop), there is a need to understand the priority and override behavior of these classes when they overlap or conflict during a window resize event.
Specifically, the interaction between generic column modifiers and breakpoint-specific modifiers can create uncertainty regarding which width takes precedence when the viewport sits exactly on a breakpoint boundary.
is-half act as a fallback for all breakpoints unless a specific modifier is present?34775 reputation · 13 Oct 2020, 01:20 UTC
Yes: a generic modifier like is-half acts as the fallback at every viewport width. Breakpoint-scoped modifiers such as is-half-desktop are wrapped in min-width media queries, so they only activate from their breakpoint upward and override the generic rule while active. At the exact breakpoint boundary, the min-width query matches, so the breakpoint-specific class wins.
Bulma's column system is mobile-first. The rules stack like this:
is-half, is-one-quarter) are plain rules with no media query. They apply everywhere.is-half-tablet, is-half-desktop, is-half-widescreen) live inside min-width media queries. Once the viewport reaches that breakpoint, the scoped rule overrides the generic one, and it keeps applying at larger breakpoints unless an even larger scoped modifier exists.is-fullwidth-mobile is the exception: it uses a max-width query targeting only the mobile range, so it stops applying once the tablet breakpoint is reached, handing control back to generic or larger-breakpoint rules.Because all these selectors have equal specificity, when two modifiers for the same breakpoint conflict (e.g., is-half-desktop and is-one-third-desktop on one element), the winner is decided by source order in the compiled stylesheet — not by the order of classes in your HTML.
For a column with is-fullwidth-mobile is-half-desktop:
is-fullwidth-mobile applies (100% width).is-half-desktop applies (50% width).That middle range is the common surprise: if you want a defined width on tablet, you must state it explicitly, e.g. is-fullwidth-mobile is-half-tablet is-one-third-desktop.
Exact breakpoint pixel values and available class names differ between Bulma versions, and custom Sass builds that change $tablet/$desktop or reorder imports change both the boundaries and source-order precedence. To confirm behavior on your install:
bulma.css for the modifier to see whether it sits in a min-width or max-width query and where it falls in source order relative to conflicting classes.flex-basis for the actual class combination you're shipping.One caveat: because specificity is tied, any later-loaded custom CSS targeting .column can silently override Bulma's modifiers. If the Styles pane shows your width coming from an unexpected file, that's the cause.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.