tree-sitter-css/corpus/declarations.txt

98 lines
1.7 KiB
Plaintext

==========================
Function calls
==========================
a {
color: rgba(0, 255, 0, 0.5);
}
---
(stylesheet
(rule_set
(selectors (tag_name))
(block
(declaration
(property_name)
(call_expression (function_name) (arguments
(integer_value)
(integer_value)
(integer_value)
(float_value)))))))
============================
Color literals
============================
a {
b: #fafd04;
c: #fafd0401;
}
---
(stylesheet
(rule_set
(selectors (tag_name))
(block
(declaration (property_name) (color_value))
(declaration (property_name) (color_value)))))
============================
Numbers
============================
a {
b: 0.5%;
c: 5em;
margin: 10E3px;
}
---
(stylesheet
(rule_set (selectors (tag_name)) (block
(declaration (property_name) (float_value (unit)))
(declaration (property_name) (integer_value (unit)))
(declaration (property_name) (float_value (unit))))))
============================
Binary arithmetic operators
============================
a {
width: calc(100% - 80px);
aspect-ratio: 1/2;
}
---
(stylesheet
(rule_set
(selectors (tag_name))
(block
(declaration
(property_name)
(call_expression (function_name) (arguments (binary_expression (integer_value (unit)) (integer_value (unit))))))
(declaration
(property_name)
(binary_expression (integer_value) (integer_value))))))
============================
Strings
============================
a {
b: '';
c: '\'hi\'';
}
---
(stylesheet
(rule_set
(selectors (tag_name))
(block
(declaration (property_name) (string_value))
(declaration (property_name) (string_value)))))