Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Best practices for assigning colors – Bootstrap classes

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #278050
    KarlDandleton
    Participant

    Our front-end dev currently uses Bootstrap for assigning colors to many elements. Once we complete a comp (HTML + CSS) we will hand off the HTML to the devs with the expectation that we can make additional adjustments to the CSS but we will not touch the HTML. This avoids the front-end dev making changes to the HTML that could affect things the other devs are working on. However, that means that if we want to change the color of an element that was assigned via a Bootstrap class (e.g., text-primary, btn-success, etc.) we then need to coordinate with the dev to make the changes. In our case, the obvious answer is to not assign colors via Bootstrap classes, but it seemed like a clunky way to style elements to begin with. Are there any articles or best practices about assigning colors through pre-built classes like this?

    #278052
    Paulie_D
    Member

    Are there any articles or best practices about assigning colors through pre-built classes like this?

    Bootstrap is a Framework…and is not intended to be a hard and fast “do not change” thing.

    If you as a designer decide that a particular element needs a different style then there is zero reason why this should not be changed.

    Indeed, Bootstrap will let you customise most of the elements / classes specifically for this reason – https://getbootstrap.com/docs/3.3/customize/

    #278055
    KarlDandleton
    Participant

    Thanks for the response Paulie. The question wasn’t really about editing the Bootstrap color classes though. I know that is possible to edit the Bootstrap color classes, but we avoid doing that to maintain consistency in our style guide (which is tangential).

    The question was: is using classes explicitly to assign colors to elements a good practice? In our case those classes happen to be Bootstrap’s color classes but it could really be classes used explicitly for assigning colors in any context (e.g., other frameworks, etc.). The approach seems clunky, but I can see some arguments for consistency and scalability with really large sites.

    Bootstrap continues to provide these classes in BS4 so somebody must be using them. However, it wasn’t clear to me whether it was a good practice to assign colors this way.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.