Comments (8)
I believe this issue has to do with this: #568
(I am facing your exact same scenario).
from dart-sass.
Ah, interesting.
I just picked apart the code, and I believe it is coming from
@function next-fa-glyph() {
$fa-glyph-counter: $fa-glyph-counter + 1 !global;
$lo-part: $fa-glyph-counter % 256;
$hi-part: ($fa-glyph-counter - $lo-part) / 256;
$hex-num-str: str-slice(#{rgb($hi-part, $lo-part, 1)}, 2, 5);
$glyph: unquote('"\\#{$hex-num-str}"');
@debug "divider offset: #{$glyph}";
@return $glyph;
}
Most specifically, the line $glyph: unquote('"\\#{$hex-num-str}"');
so I have to see what has changed.
I can't tell, but it looks like it's some cut off part of rgb(2
from dart-sass.
I used --no-charset
to avoid the issue.
from dart-sass.
I'll have to check the docs, is that even definable if you're using it as a node package and not CLI? Looked through the webpack options and didn't see that.
Only charset I saw was if I upgraded to 1.50.x something, and that was going to be my last ditch effort.
from dart-sass.
Yeah, I've gone through the code and double-checked every little thing, for some reason, it's taking my unicode values generated in scss, and converting them over to an rgb value.
The prints inside the scss return fine:
debug:: f099
But since I'm using "rgb" for math, once I switch over to sass 1.49.10, it returns rgb instead of what it originally did.
Before 1.49.10
icon-font.scss:36:4: Level 1: #f00101
icon-font.scss:37:4: Level 2: str-slice(#f00101, 2, 5)
icon-font.scss:36:4: Level 1: #f00201
icon-font.scss:37:4: Level 2: str-slice(#f00201, 2, 5)
icon-font.scss:36:4: Level 1: #f00301
icon-font.scss:37:4: Level 2: str-slice(#f00301, 2, 5)
After
icon-font.scss:36:4: Level 1: rgb(240, 1, 1)
icon-font.scss:37:4: Level 2: str-slice(rgb(240, 1, 1), 2, 5)
icon-font.scss:36:4: Level 1: rgb(240, 2, 1)
icon-font.scss:37:4: Level 2: str-slice(rgb(240, 2, 1), 2, 5)
icon-font.scss:36:4: Level 1: rgb(240, 3, 1)
icon-font.scss:37:4: Level 2: str-slice(rgb(240, 3, 1), 2, 5)
from dart-sass.
Ah, interesting. I just picked apart the code, and I believe it is coming from
@function next-fa-glyph() { $fa-glyph-counter: $fa-glyph-counter + 1 !global; $lo-part: $fa-glyph-counter % 256; $hi-part: ($fa-glyph-counter - $lo-part) / 256; $hex-num-str: str-slice(#{rgb($hi-part, $lo-part, 1)}, 2, 5); $glyph: unquote('"\\#{$hex-num-str}"'); @debug "divider offset: #{$glyph}"; @return $glyph; }
Most specifically, the line
$glyph: unquote('"\\#{$hex-num-str}"');
so I have to see what has changed.I can't tell, but it looks like it's some cut off part of
rgb(2
To be clear: this code is wildly unsafe, as it assumes that colors will always be serialized as hex codes which was never guaranteed by Sass. It's also totally unnecessary; you can write a function to directly convert a number into a hex code like this.
Closing as this is a bug coming from that next-fa-glyph()
function, not an issue with Sass.
from dart-sass.
Oh, that's definitely another way to do it. Very simple.
I'm not completely up on SASS yet (still learning) but is the integer restricted to certain values? It appears if you type '256' in, it states the List index may not be 0. Unless there's a restriction with list.nth I need to read up on.
Appreciate the help and the sample.
from dart-sass.
That's a bug—I've just fixed it.
from dart-sass.
Related Issues (20)
- I would like to know which version of dart-sass supports node v10.18.0? HOT 1
- At-rules may not be used within keyframe blocks HOT 1
- Null check operator used on a null value error since 1.76.0 HOT 7
- "braces" dependency vulnerable to "Uncontrolled resource consumption" CVE HOT 2
- --silence-deprecation doesn't work on the CLI HOT 1
- CLI Many-to-Many Mode process .css files HOT 2
- Converting .sass to .scss? HOT 1
- Add WASM compilation target HOT 2
- @use file cannot use variables starting with $-- HOT 1
- Setup arm64 linux/windows runners for AOT releases HOT 5
- dart-sass maven plugin 1.77.4 is not a Win32 valid application HOT 4
- Silent comments are incorrectly preserved in at-rule values
- NPM Pack is failing for version 1.62.1 HOT 1
- Install defaults to C:/Tools on Windows!!! HOT 1
- Switching git branches while in watch mode causes 'can't find stylesheet to import' HOT 2
- 1.77.7 wasn't published to NPM HOT 1
- `mixed_decls` produces too much noise for developers with mixins HOT 25
- An option to make nested warning (and similar warnings) fatal HOT 1
- sass --embedded doesn't reliably exit when closing stdin on Windows HOT 4
- trying ignore `mixed-decls` warning but still got these warning in Vite(`5.3.1`). HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dart-sass.