Ant Design Svelte

Color

Color helps distinguish an action from text, and a normal state from a warning or error. Its role must be maintained across all pages of the application.

Color roles

Role Application Design token
Main Main action, selected item colorPrimary
Success Completed operation colorSuccess
Warning Situation requiring attention colorWarning
Error Failed action or incorrect input colorError
Text and surfaces Reading, background, borders colorText, colorBgContainer, colorBorder

Don't represent a state with just one color: add a signature, icon, or message. Adjacent elements must be distinguishable even without hue recognition.

Success
Warning
Error
Information
Functional colours preserve the meaning of each state.

Product palette

Ant Design has basic color palettes and neutral shades. In your product, choose a primary color and use semantic roles consistently. To configure, pass colorPrimary to the ConfigProvider theme.

Don't fix white background and black text in app components: use current theme tokens to maintain readability in dark mode.

Main action colorPrimary
Selected item colorPrimaryBg
Link colorLink
The primary colour connects actions, selection and visual accents.

Checking states

Compare normal, hover, focus, active and disabled states. Check the text on top of the selected fill and the errors on the background of the field. Setting up a theme describes common and component tokens, and ColorPicker allows you to work with custom color.

Model and system levels

Ant Design distinguishes system palettes from product palettes. The system defines coordinated hues, neutral colours and a foundation for visualisation. A product selects a primary colour and connects other roles with its tasks. HSB separates hue, saturation and brightness when discussing a colour independently of its CSS representation.

Base palettes

The base system contains twelve colour families with ten steps each. The sixth step of a light palette is commonly used as a primary colour; other steps support backgrounds, borders and interaction states. Dark mode recalculates relationships for its surroundings.

The palette below reads current public theme tokens. Selecting a primary colour recalculates its semantic roles within the example. The header theme settings let you compare light and dark systems without copying values from CSS.

Palette primary colour
colorPrimaryBg
#e6f4ff
colorPrimaryBorder
#91caff
colorPrimaryHover
#4096ff
colorPrimary
#1677ff
colorPrimaryActive
#0958d9
colorText
rgba(0,0,0,0.88)
colorTextSecondary
rgba(0,0,0,0.65)
colorBgContainer
#ffffff

red

  1. #fff1f01
  2. #ffccc72
  3. #ffa39e3
  4. #ff78754
  5. #ff4d4f5
  6. #f5222d6
  7. #cf13227
  8. #a8071a8
  9. #8200149
  10. #5c001110

volcano

  1. #fff2e81
  2. #ffd8bf2
  3. #ffbb963
  4. #ff9c6e4
  5. #ff7a455
  6. #fa541c6
  7. #d4380d7
  8. #ad21028
  9. #8714009
  10. #610b0010

orange

  1. #fff7e61
  2. #ffe7ba2
  3. #ffd5913
  4. #ffc0694
  5. #ffa9405
  6. #fa8c166
  7. #d46b087
  8. #ad4e008
  9. #8738009
  10. #61250010

gold

  1. #fffbe61
  2. #fff1b82
  3. #ffe58f3
  4. #ffd6664
  5. #ffc53d5
  6. #faad146
  7. #d488067
  8. #ad68008
  9. #874d009
  10. #61340010

yellow

  1. #feffe61
  2. #ffffb82
  3. #fffb8f3
  4. #fff5664
  5. #ffec3d5
  6. #fadb146
  7. #d4b1067
  8. #ad8b008
  9. #8768009
  10. #61470010

lime

  1. #fcffe61
  2. #f4ffb82
  3. #eaff8f3
  4. #d3f2614
  5. #bae6375
  6. #a0d9116
  7. #7cb3057
  8. #5b8c008
  9. #3f66009
  10. #25400010

green

  1. #f6ffed1
  2. #d9f7be2
  3. #b7eb8f3
  4. #95de644
  5. #73d13d5
  6. #52c41a6
  7. #389e0d7
  8. #2378048
  9. #1352009
  10. #092b0010

cyan

  1. #e6fffb1
  2. #b5f5ec2
  3. #87e8de3
  4. #5cdbd34
  5. #36cfc95
  6. #13c2c26
  7. #08979c7
  8. #006d758
  9. #00474f9
  10. #00232910

blue

  1. #e6f4ff1
  2. #bae0ff2
  3. #91caff3
  4. #69b1ff4
  5. #4096ff5
  6. #1677ff6
  7. #0958d97
  8. #003eb38
  9. #002c8c9
  10. #001d6610

geekblue

  1. #f0f5ff1
  2. #d6e4ff2
  3. #adc6ff3
  4. #85a5ff4
  5. #597ef75
  6. #2f54eb6
  7. #1d39c47
  8. #10239e8
  9. #0611789
  10. #03085210

purple

  1. #f9f0ff1
  2. #efdbff2
  3. #d3adf73
  4. #b37feb4
  5. #9254de5
  6. #722ed16
  7. #531dab7
  8. #3910858
  9. #22075e9
  10. #12033810

magenta

  1. #fff0f61
  2. #ffd6e72
  3. #ffadd23
  4. #ff85c04
  5. #f759ab5
  6. #eb2f966
  7. #c41d7f7
  8. #9e10688
  9. #7806509
  10. #52033910

Colour roles and palettes

ColorPicker changes the primary colour; public tokens show semantic roles and twelve base palettes.

Neutral colours

Text, surfaces, borders and dividers occupy most of a work interface. Their differences establish hierarchy without constant vivid accents. Opacity combines with the background to determine the result, so evaluate a colour on its actual surface rather than as an isolated sample.

Adapted from the guide by Ant Design. MIT.