Bulma: .section background color is set to $white instead of $background

Created on 28 Apr 2017  路  11Comments  路  Source: jgthms/bulma



Overview of the problem

This is about the Bulma CSS framework

I'm using Bulma version [0.4.1]


Description

The .section class, found in sass/layout/section.sass, has a set background color of $white.
As this is a layout class I would expect there to be no background color set -- or if necessary (for some reason), that the background color be set to $background from the initial variables.

Steps to Reproduce

Add a section class to div on a page with a non-white background.

Expected behavior

As this is a layout class I would expect there to be no background color set -- or if necessary (for some reason), that the background color be set to $background from the initial variables.

Actual behavior

The background of the div is white and must be overridden

EDIT: I removed the !important override in the ###Actual behavior; turns out I had the minireset compiling into my project twice by accident. I still believe a layout class shouldn't have a background.

bulma question

Most helpful comment

You are right.

All 11 comments

Totally agree. Had the same problem and need to overwrite section class.

+1

This is actually a problem on a number of components as well. Card, code/pre, modal, nav, box... I'd like to see each component and layout class have their own variables with a white default, like how inputs and buttons have $input-background and $button-background.

I dont think the .section class should have any background color set. Just have it transparent.

If this would be configurable through $background whatever, you could easily set it to transparent. ...

Yes true. I would expect $background to be used for body - as well as being available in your own sass to use on whichever elements you like.

But for .section I dont see how setting a background of $background by default is neccessary. By having it set to transparent, it would automatically show the background colour of body through. Which is what i'd expect to happen. If I wanted to set a different background color for a particular section then I would just create some custom class to do so.

By default though there's no point in setting a background color for .section.

You are right.

Maybe we should just make the hero element "is-primary", "is-info" available as global modifiers for background?

The section has no background now.

@jgthms could you elaborate on this? I'm trying to figure out the correct way to set the background color of a section with Bulma.

I would imagine you set a background colour with your own css. @captDaylight

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fundon picture fundon  路  3Comments

NurdinDev picture NurdinDev  路  3Comments

swthate picture swthate  路  3Comments

leofontes picture leofontes  路  3Comments

guillecro picture guillecro  路  3Comments