We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60def2e commit d25744eCopy full SHA for d25744e
lib/sass/compiler/host/protofier.rb
@@ -112,13 +112,14 @@ def from_proto(proto)
112
when :number
113
Number.from_proto(obj)
114
when :color
115
+ obj.to_s # TODO: https://github.com/protocolbuffers/protobuf/issues/18807
116
Sass::Value::Color.send(
117
:for_space,
118
obj.space,
- obj.channel1,
119
- obj.channel2,
120
- obj.channel3,
121
- obj.alpha
+ obj.has_channel1? ? obj.channel1 : nil,
+ obj.has_channel2? ? obj.channel2 : nil,
+ obj.has_channel3? ? obj.channel3 : nil,
122
+ obj.has_alpha? ? obj.alpha : nil
123
)
124
when :argument_list
125
Sass::Value::ArgumentList.new(
spec/sass_proto_spec.rb
@@ -63,9 +63,9 @@ def remote_eq(lhs, rhs)
63
])
64
]),
65
__LINE__ => Sass::Value::Calculation.clamp(Sass::Value::String.new('var(--clamp)', quoted: false)),
66
- __LINE__ => Sass::Value::Color.new(red: 0, green: 0, blue: 0, alpha: 1),
67
- __LINE__ => Sass::Value::Color.new(hue: 0, saturation: 0, lightness: 0, alpha: 1),
68
- __LINE__ => Sass::Value::Color.new(hue: 0, whiteness: 0, blackness: 0, alpha: 1),
+ __LINE__ => Sass::Value::Color.new(red: 0.1, green: 0.2, blue: nil, alpha: 1, space: 'rgb'),
+ __LINE__ => Sass::Value::Color.new(hue: 0.4, saturation: nil, lightness: 0.6, alpha: 1, space: 'hsl'),
+ __LINE__ => Sass::Value::Color.new(hue: nil, whiteness: 0.8, blackness: 0.9, alpha: 1, space: 'hwb'),
69
__LINE__ => Sass::Value::List.new,
70
__LINE__ => Sass::Value::List.new([Sass::Value::String.new('a')]),
71
__LINE__ => Sass::Value::List.new([Sass::Value::String.new('a')], separator: ','),
0 commit comments