Skip to main content

Color

Bulma provides a comprehensive set of color helpers for text and background colors. These helpers allow you to quickly apply consistent coloring throughout your application without writing custom CSS.

tip

All components in bestax-bulma have access to these standard color properties through the useBulmaClasses hook. This means you can apply color properties to any component in the library.

Text Color

Use the color prop to apply text colors to any component. The color prop accepts Bulma's standard color palette.

Standard Colors

PropertyBulma ClassColor Value
color="primary"has-text-primaryPrimary theme color
color="link"has-text-linkLink color
color="info"has-text-infoInfo blue
color="success"has-text-successSuccess green
color="warning"has-text-warningWarning yellow
color="danger"has-text-dangerDanger red

Monochrome Colors

PropertyBulma ClassColor Value
color="black"has-text-blackPure black
color="black-bis"has-text-black-bisAlmost black
color="black-ter"has-text-black-terDark grey
color="grey-darker"has-text-grey-darkerDarker grey
color="grey-dark"has-text-grey-darkDark grey
color="grey"has-text-greyStandard grey
color="grey-light"has-text-grey-lightLight grey
color="grey-lighter"has-text-grey-lighterLighter grey
color="white"has-text-whitePure white

Theme Colors

PropertyBulma ClassColor Value
color="light"has-text-lightLight theme color
color="dark"has-text-darkDark theme color

Special Colors

PropertyBulma ClassColor Value
color="inherit"has-text-inheritInherit from parent
color="current"has-text-currentCurrent color value

Example Usage

import { Title, SubTitle, Button, Buttons, Box } from '@allxsmith/bestax-bulma';

function ColorExamples() {
  return (
    <Box p="4">
      <Title color="primary">Primary colored title</Title>
      <SubTitle color="info">Info colored subtitle</SubTitle>

      <Buttons>
        <Button color="success">Success button</Button>
        <Button color="warning">Warning button</Button>
        <Button color="danger">Danger button</Button>
      </Buttons>

      <p>
        <span color="grey">Grey text </span>
        <span color="black">Black text </span>
        <span color="white">White text</span>
      </p>
    </Box>
  );
}

Background Color

Use the backgroundColor prop to apply background colors to any component. The backgroundColor prop accepts the same color values as the text color prop.

Standard Background Colors

PropertyBulma ClassBackground Value
backgroundColor="primary"has-background-primaryPrimary theme background
backgroundColor="link"has-background-linkLink background
backgroundColor="info"has-background-infoInfo blue background
backgroundColor="success"has-background-successSuccess green background
backgroundColor="warning"has-background-warningWarning yellow background
backgroundColor="danger"has-background-dangerDanger red background

Monochrome Backgrounds

PropertyBulma ClassBackground Value
backgroundColor="black"has-background-blackBlack background
backgroundColor="black-bis"has-background-black-bisAlmost black background
backgroundColor="black-ter"has-background-black-terDark grey background
backgroundColor="grey-darker"has-background-grey-darkerDarker grey background
backgroundColor="grey-dark"has-background-grey-darkDark grey background
backgroundColor="grey"has-background-greyStandard grey background
backgroundColor="grey-light"has-background-grey-lightLight grey background
backgroundColor="grey-lighter"has-background-grey-lighterLighter grey background
backgroundColor="white"has-background-whiteWhite background

Theme Backgrounds

PropertyBulma ClassBackground Value
backgroundColor="light"has-background-lightLight theme background
backgroundColor="dark"has-background-darkDark theme background

Example Usage

import { Box, Notification, Card } from '@allxsmith/bestax-bulma';

function BackgroundColorExamples() {
  return (
    <div>
      <Box backgroundColor="primary" color="white" p="4" mb="3">
        Primary background with white text
      </Box>

      <Box backgroundColor="info" color="white" p="4" mb="3">
        Info background with white text
      </Box>

      <Notification backgroundColor="success" color="white">
        Success notification with custom colors
      </Notification>

      <Card backgroundColor="light" p="4">
        <Card.Content>Light background card</Card.Content>
      </Card>
    </div>
  );
}

Advanced Color Features

For more advanced color features including comprehensive shade variations and semantic color meanings, see the Color Shades documentation.

Learn More

For detailed API information about color properties, see the useBulmaClasses API documentation.

See Also