Skip to content
GitLab
    • Explore Projects Groups Snippets
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
  • !35134

Correctly evaluate whether a link color should be shaded or tinted

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/ntnz/patch-1 into main 3 years ago
  • Overview 3
  • Commits 2
  • Pipelines 0
  • Changes 1

Created by: ntnz

In its current state, lights are mixed with white, and darks are mixed with black. If the intention is to create contrast, this seems incorrect.

You can see this problem in action in the docs: https://getbootstrap.com/docs/5.0/helpers/colored-links/

Using the .link-light example on the docs page: 136474680-935b60f8-159a-4b7f-bc20-b4394c12d4bb The link has the color of #f8f9fa.

On hover, the color is lightened to #f9fafb: 136474750-e85cd50d-61e8-475a-80fb-223952479d38

Checking approval status

Closed by (Jan 12, 2025 4:01pm UTC)

Loading

Activity


  • Administrator requested review from @ghost 3 years ago

    requested review from @ghost

  • Administrator
    Administrator @root · 3 years ago
    Author Contributor

    Created by: ffoodd

    Light links are meant to be used on dark background (e.g. .bg-dark) to provide sufficient contrasts.

    Consequently, lightening it on hover provides more contrasts.

    I don't think there's something to change here. What am I missing?

  • Administrator
    Administrator @root · 3 years ago
    Author Contributor

    Created by: ntnz

    Technically you do get more background contrast, but the change is almost not perceivable.

    In the case of .link-light, you're mixing a shade that's almost white with 20% more white which doesn't make a noticeable difference. The same applies to .link-dark.

    I've made a pen that showcases what I'm talking about. The original side is the unmodified Bootstrap CSS, the modified side contains the PR changes.

  • Administrator
    Administrator @root · 3 years ago
    Author Contributor

    Created by: ffoodd

    Checking this PR preview, I can confirm you're lowering contrasts on most of colored links on a light background. Simply compare to our current release. So I'm closing this since it does not meet our accessibility efforts—but thanks a lot for submitting this and question the current way.

    We need to document background usage, mostly because light, info and warning links should not be used on a light background.

    An interesting idea would be to switch between tint and shade depending on background, but ATM we have no way to know which background is used. A custom property on our background utilities could carry a value to determine this and give some context to colored links helper. But we're not there yet.

  • Administrator closed 3 years ago

    closed

Please register or sign in to reply
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
2
2 participants
Administrator
Ghost User
Reference: twbs/bootstrap!35134
Source branch: github/fork/ntnz/patch-1

Menu

Explore Projects Groups Snippets