Giter VIP home page Giter VIP logo

Comments (8)

axllent avatar axllent commented on June 14, 2024 1

I am experiencing an issue too which I think is related, if not a sign of the cause (which hopefully can help you identify where this is happening). When compiling bootstrap (5) minify <= 1.3.71 produces:

color:rgba(var(--bs-link-color-rgb),var(--bs-link-opacity,1)); // correct

With 1.3.72 the same code produces the following invalid css:

color:rgb(var(--bs-link-color-rgb) var(--bs-link-opacity 1)); // invalid

This may not be limited to just this, but it is definitely something I can pinpoint.

from minify.

CreativeNative avatar CreativeNative commented on June 14, 2024 1

Yes, it's definitely a problem with the bootstrap framework and color. I'm experiencing the same issue. Grids and everything else are working fine, but colors don't work.

@matthiasmullie I will send you our CSS minified with version 1.3.71 and 1.3.72 via e-mail, so you can see the difference.

I compared both files and saw following changes (1.3.71 -> 1.3.72)

"transparent" went to "#fff0"

"rgba(0,0,0,.125)" went to "rgb(0 0 0 / .125)"

"RGBA(var(--bs-primary-rgb),var(--bs-bg-opacity,1))" went to "RGB(var(--bs-primary-rgb) var(--bs-bg-opacity 1)"

from minify.

CreativeNative avatar CreativeNative commented on June 14, 2024 1

I will check in the afternoon and let you know. ๐Ÿ˜‰

from minify.

axllent avatar axllent commented on June 14, 2024 1

@matthiasmullie I can confirm the fix in the master branch resolves color issue for me (color:rgba(var(--bs-link-color-rgb),var(--bs-link-opacity,1));) . But...

"rgba(0,0,0,.125)" went to "rgb(0 0 0 / .125)"

I'm still seeing rgb(0 0 0 / .125) multiple times in my compressed version, so I do not believe it is entirely fixed (unless that is actually valid?).

Thank you for looking into this so quickly.

from minify.

matthiasmullie avatar matthiasmullie commented on June 14, 2024 1

That last change is actually valid; the rgb(0 0 0 / .125) is actually the "modern" format, while the comma-separated format is considered legacy (see https://drafts.csswg.org/css-color/#color-syntax-modern)

I just released a new version - should any more issues crop up, don't hesitate to file a bug report! :)
Thanks again to both of you!

from minify.

matthiasmullie avatar matthiasmullie commented on June 14, 2024

Hi! Can you describe the problem you're seeing? Or post the CSS that fails to minify properly? Or you can email me at minify[at]mullie[dot]eu if you wish to keep the CSS private.

from minify.

matthiasmullie avatar matthiasmullie commented on June 14, 2024

Hi - thanks again for your reports of this bug.

AFAICT, the patch that introduced some color conversions went a little haywire here - it essentially split rgb/hsl values on comma, but bootstrap makes extensive use of var() for color values, and var() itself can also be used with a 2nd argument (for default value), which introduces an unexpected comma.

I submitted a new commit that is supposed to tighten this up and only operate on literal values (not var())

Could any of you please test current master branch & report whether the fix is adequate before I publish a new release?

Thanks!

from minify.

axllent avatar axllent commented on June 14, 2024

Awesome, you're a star! Thank you again.

from minify.

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.