Skip to content

Design System Audit: Swap colors with color variables: blues #2204

@abuna1985

Description

@abuna1985

Overview

As a developer, hard-coding colors only makes things difficult when colors change. For this only change the blue colors so we can use the color variables.

Action Items

  • Refer to /_sass/variables/_colors.scss for the current color variables (blues)
  • Replace all instances of the hard-coded colors with the color variables
    • Make sure to do this carefully, as some changes might break the website
    • If it breaks, investigate why and make edits accordingly. Ask for help if needed.
  • If a color variable is unused, delete it from the files noted above.
  • Release dependency on Design System Audit: Audit for hardcoded colors #2114 , if conditions are met

Resources/Instructions

// Blues
$color-midnightblue: #173567;
$color-darkroyalblue: #01548a;
$color-blue: #046afa;
$color-royalblue: #4169e1;
$color-brightblue: #0000ff;
$color-azure: #407BFF;
$color-dodgerblue: #1587FF;
$color-babyblue: #a4d5ff;
$color-skyblue: #89cff0;

If the task seems tedious, this might smooth things along if your native IDE is VSCode. Other IDEs might also have similar functionality.
Advanced find and replace options for VSCode

You can do a search within VS Code with the following values:

Search: hex color goes here
Replace: color variable goes here
files to include: ./
files to exclude: *.svg, _site, _colors.scss

Once the values are in the search form, do the following actions:

  1. Click on the Replace All button (shortcut: Ctrl+Alt+Enter)
  2. Click Ok to confirm replace
Click here to see visual example of search/replace for color variables within VS code

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions