Coder Social home page Coder Social logo

Comments (3)

julien-deramond avatar julien-deramond commented on April 27, 2024

Thanks for opening this issue @miken32
The fix has been done for opaque because we used 100 instead of 100% within this function and the modification was:

@function opaque($background, $foreground) {
-  @return mix(rgba($foreground, 1), $background, opacity($foreground) * 100);
+  @return mix(rgba($foreground, 1), $background, opacity($foreground) * 100%);
}

For tint-color() and shade-color(), we call mix() with the same exact parameter without transforming it; for example:

@function tint-color($color, $weight) {
  @return mix(white, $color, $weight);
}

@function shade-color($color, $weight) {
  @return mix(black, $color, $weight);
}

My first feeling would be to keep that as-is. It seems more logical to have the exact same type of parameter as Sass itself.

from bootstrap.

miken32 avatar miken32 commented on April 27, 2024

from bootstrap.

julien-deramond avatar julien-deramond commented on April 27, 2024

Yep, based on your example, you'll just have to use % in order to make disappear the warnings:

.foo-warnings {
  color: shift-color($success, 48);
  background: shift-color($success, -72);
}

.foo-no-warnings {
  color: shift-color($success, 48%);
  background: shift-color($success, -72%);
}

I’ll leave it to your team to decide whether to change anything or just update documentation.

This is something already mentioned in Customize > Sass > Colors with the following:

.custom-element {
  color: tint-color($primary, 10%);
}

.custom-element-2 {
  color: shade-color($danger, 30%);
}

But let's suggest a PR to add a .custom-element-3 additional example with shift-color() usage too: #39435

from bootstrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.