File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,16 @@ namespace Sass {
17
17
starts_with (str, " var(" );
18
18
}
19
19
20
+ void hsla_alpha_percent_deprecation (const ParserState& pstate, const std::string val)
21
+ {
22
+
23
+ std::string msg (" Passing a percentage as the alpha value to hsla() will be interpreted" );
24
+ std::string tail (" differently in future versions of Sass. For now, use " + val + " instead." );
25
+
26
+ deprecated (msg, tail, false , pstate);
27
+
28
+ }
29
+
20
30
Signature rgb_sig = " rgb($red, $green, $blue)" ;
21
31
BUILT_IN (rgb)
22
32
{
@@ -211,6 +221,15 @@ namespace Sass {
211
221
);
212
222
}
213
223
224
+ Number_Ptr alpha = ARG (" $alpha" , Number);
225
+ if (alpha && alpha->unit () == " %" ) {
226
+ Number_Obj val = SASS_MEMORY_COPY (alpha);
227
+ val->numerators .clear (); // convert
228
+ val->value (val->value () / 100.0 );
229
+ std::string nr (val->to_string (ctx.c_options ));
230
+ hsla_alpha_percent_deprecation (pstate, nr);
231
+ }
232
+
214
233
return SASS_MEMORY_NEW (Color_HSLA,
215
234
pstate,
216
235
ARGVAL (" $hue" ),
You can’t perform that action at this time.
0 commit comments