summaryrefslogtreecommitdiffstats
path: root/theme-compiler/tests
diff options
context:
space:
mode:
authorHenri Sara <hesara@vaadin.com>2012-11-27 13:01:21 +0200
committerHenri Sara <hesara@vaadin.com>2012-11-27 13:02:53 +0200
commit82120d5db9eee301143e234d0217b0083b8c97ec (patch)
tree0a51d27592b86fba8ea45079164a79c4aead4666 /theme-compiler/tests
parentbcad61f83313b7ed73f56db39371491abe38e267 (diff)
downloadvaadin-framework-82120d5db9eee301143e234d0217b0083b8c97ec.tar.gz
vaadin-framework-82120d5db9eee301143e234d0217b0083b8c97ec.zip
Support for all valid CSS selectors (#10316)
Add support for pseudo-functions like ":nth-child(n)". Add support for sibling selector "E ~ F". Add support for unknown pseudo-functions taking an identifier such as ":not(s)". Change-Id: I39b31fa99f031b31b215058a45b74e40b23191f3
Diffstat (limited to 'theme-compiler/tests')
-rw-r--r--theme-compiler/tests/resources/automatic/css/selector_types.css63
-rw-r--r--theme-compiler/tests/resources/automatic/scss/selector_types.scss63
2 files changed, 126 insertions, 0 deletions
diff --git a/theme-compiler/tests/resources/automatic/css/selector_types.css b/theme-compiler/tests/resources/automatic/css/selector_types.css
new file mode 100644
index 0000000000..b0f98c9267
--- /dev/null
+++ b/theme-compiler/tests/resources/automatic/css/selector_types.css
@@ -0,0 +1,63 @@
+* {
+ type: universal;
+}
+
+attrib .attrib {
+ type: attribute;
+}
+
+.attrib[foo] .attrib[foo="bar"] .attrib[foo~="bar"] .attrib[foo^="bar"] .attrib[foo$="bar"] .attrib[foo*="bar"] .attrib[foo|="bar"] {
+ type: attribute;
+}
+
+.pseudo:root .pseudo:first-child {
+ type: pseudo-class;
+}
+
+.pseudo:root .pseudo:first-child {
+ type: pseudo-class;
+}
+
+.pseudo:nth-child(3) {
+ type: pseudo-class;
+}
+
+.pseudo:lang(fr) {
+ type: pseudo-class;
+}
+
+.pseudo:not(s) .pseudo:not(.s) {
+ type: pseudo-class;
+}
+
+.pseudo::after {
+ type: pseudo-element;
+}
+
+.pseudo[foo="bar"]::after {
+ type: pseudo-combined;
+}
+
+.foo.warning {
+ type: class;
+}
+
+.id#myid {
+ type: id;
+}
+
+E F {
+ type: descendant;
+}
+
+E > F {
+ type: child;
+}
+
+E + F {
+ type: adjacent;
+}
+
+E ~ F {
+ type: sibling;
+}
diff --git a/theme-compiler/tests/resources/automatic/scss/selector_types.scss b/theme-compiler/tests/resources/automatic/scss/selector_types.scss
new file mode 100644
index 0000000000..b0f98c9267
--- /dev/null
+++ b/theme-compiler/tests/resources/automatic/scss/selector_types.scss
@@ -0,0 +1,63 @@
+* {
+ type: universal;
+}
+
+attrib .attrib {
+ type: attribute;
+}
+
+.attrib[foo] .attrib[foo="bar"] .attrib[foo~="bar"] .attrib[foo^="bar"] .attrib[foo$="bar"] .attrib[foo*="bar"] .attrib[foo|="bar"] {
+ type: attribute;
+}
+
+.pseudo:root .pseudo:first-child {
+ type: pseudo-class;
+}
+
+.pseudo:root .pseudo:first-child {
+ type: pseudo-class;
+}
+
+.pseudo:nth-child(3) {
+ type: pseudo-class;
+}
+
+.pseudo:lang(fr) {
+ type: pseudo-class;
+}
+
+.pseudo:not(s) .pseudo:not(.s) {
+ type: pseudo-class;
+}
+
+.pseudo::after {
+ type: pseudo-element;
+}
+
+.pseudo[foo="bar"]::after {
+ type: pseudo-combined;
+}
+
+.foo.warning {
+ type: class;
+}
+
+.id#myid {
+ type: id;
+}
+
+E F {
+ type: descendant;
+}
+
+E > F {
+ type: child;
+}
+
+E + F {
+ type: adjacent;
+}
+
+E ~ F {
+ type: sibling;
+}