Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4: suggestion to introduce a color contrast function #18119

Closed
bassjobsen opened this issue Oct 31, 2015 · 3 comments
Closed

v4: suggestion to introduce a color contrast function #18119

bassjobsen opened this issue Oct 31, 2015 · 3 comments

Comments

@bassjobsen
Copy link
Contributor

for instance: http://compass-style.org/reference/compass/utilities/color/contrast/#function-contrast-color

Useful in among others mixins/background-variants.scss:

// Contextual backgrounds

// [converter] $parent hack
@mixin bg-variant($parent, $color) {
  #{$parent} {
    color: contrast-color($color,$gray-dark,$gray-lightest);
    background-color: $color;
  }
  a#{$parent} {
    @include hover-focus {
      background-color: darken($color, 10%);
    }
  }
}

See also: #18118

@cvrebert
Copy link
Collaborator

X-Ref: #3224

@mdo
Copy link
Member

mdo commented Dec 8, 2015

Yeah, could be nice to do something here as a utility function across the project.

@mdo mdo removed the confirmed label Nov 26, 2016
@mdo mdo added this to the v4.1 ideas milestone Nov 26, 2016
@PascalPixel
Copy link
Contributor

PascalPixel commented Apr 6, 2017

I'd like to suggest an actual dark/light distinction with a single body.inverse class.
I'd go further and say an automatically generated color-palette would be impressive as well.
Perhaps copy https://github.com/simurai/duotone-light-syntax
And https://github.com/simurai/duotone-dark-syntax

I'd be happy to give it a shot if interested @mdo

@mdo mdo mentioned this issue May 1, 2017
4 tasks
@mdo mdo mentioned this issue Jun 28, 2017
5 tasks
@mdo mdo modified the milestones: v4.1 ideas, v4.0.0-beta Jun 30, 2017
@mdo mdo added the has-pr label Jun 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants