Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !38044

Update form validation styles to use new CSS variables for `color` and `border-color`

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Mark Otto requested to merge form-validation-color-modes into main Feb 14, 2023
  • Overview 3
  • Commits 2
  • Pipelines 0
  • Changes 4

Linked to #38041.

This is an alternate fix that includes some new CSS variables dedicated to form validation valid and invalid colors. This approach should suffice for a number of customization options while also solving our color contrast and color mode issues.

  • We're not programmatically generating the CSS variables for form validation states (e.g., if folks move from valid/invalid to custom ones like warning/error), but that's okay I think. Maybe something to tackle in v6 if possible.
  • This means folks can customize via Sass only (the validation map, Sass variables, and Sass mixin), or via CSS variables, depending on their needs.

What this doesn't, and can't, resolve is the icon color since we're embedding SVGs. I don't think the path of duplicating the SVG as embedded in our CSS is a good option either since that adds a good chunk of file size.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: form-validation-color-modes