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
  • Issues
  • #38211
Closed
Open
Issue created Mar 10, 2023 by devhoussam1998@devhoussam19982 of 2 checklist items completed2/2 checklist items

The btn-variant-mixin functionality should be implemented across other components like dropdowns as well.

Prerequisites

  • I have searched for duplicate or closed feature requests
  • I have read the contributing guidelines

Proposal

this is btn-variant-mixin

Screenshot 2023-03-10 at 23 10 18

the same functionality should be implemented across other components in this example I choose dropdonws

Screenshot 2023-03-10 at 23 10 35

The button color appears black because the selected color does not meet the minimum contrast ratio, but this option is not available for other components.

// Define the dropdown-variant mixin
@mixin dropdown-variant(
  $background,
  $border,
  $color: color-contrast($background),
) {
  --#{$prefix}dropdown-color: #{$color};
  --#{$prefix}dropdown-bg: #{$background};
  --#{$prefix}dropdown-border-color: #{$border};
}

// Use the mixin inside .dropdown-menu
.dropdown-menu {
  // Use the mixin for the default variant
  @include dropdown-variant(red, blue, yellow);
}

Motivation and context

Assignee
Assign to
Time tracking