|
1928 | 1928 | ] |
1929 | 1929 | } |
1930 | 1930 | } |
| 1931 | + }, |
| 1932 | + "element-pseudo-class-nested": { |
| 1933 | + "source": "main { p:first-of-type { margin-top: 0; } }", |
| 1934 | + "generate": "main{p:first-of-type{margin-top:0}}", |
| 1935 | + "ast": { |
| 1936 | + "type": "Rule", |
| 1937 | + "prelude": { |
| 1938 | + "type": "SelectorList", |
| 1939 | + "children": [ |
| 1940 | + { |
| 1941 | + "type": "Selector", |
| 1942 | + "children": [ |
| 1943 | + { |
| 1944 | + "type": "TypeSelector", |
| 1945 | + "name": "main" |
| 1946 | + } |
| 1947 | + ] |
| 1948 | + } |
| 1949 | + ] |
| 1950 | + }, |
| 1951 | + "block": { |
| 1952 | + "type": "Block", |
| 1953 | + "children": [ |
| 1954 | + { |
| 1955 | + "type": "Rule", |
| 1956 | + "prelude": { |
| 1957 | + "type": "SelectorList", |
| 1958 | + "children": [ |
| 1959 | + { |
| 1960 | + "type": "Selector", |
| 1961 | + "children": [ |
| 1962 | + { |
| 1963 | + "type": "TypeSelector", |
| 1964 | + "name": "p" |
| 1965 | + }, |
| 1966 | + { |
| 1967 | + "type": "PseudoClassSelector", |
| 1968 | + "name": "first-of-type", |
| 1969 | + "children": null |
| 1970 | + } |
| 1971 | + ] |
| 1972 | + } |
| 1973 | + ] |
| 1974 | + }, |
| 1975 | + "block": { |
| 1976 | + "type": "Block", |
| 1977 | + "children": [ |
| 1978 | + { |
| 1979 | + "type": "Declaration", |
| 1980 | + "important": false, |
| 1981 | + "property": "margin-top", |
| 1982 | + "value": { |
| 1983 | + "type": "Value", |
| 1984 | + "children": [ |
| 1985 | + { |
| 1986 | + "type": "Number", |
| 1987 | + "value": "0" |
| 1988 | + } |
| 1989 | + ] |
| 1990 | + } |
| 1991 | + } |
| 1992 | + ] |
| 1993 | + } |
| 1994 | + } |
| 1995 | + ] |
| 1996 | + } |
| 1997 | + } |
| 1998 | + }, |
| 1999 | + "element-pseudo-class-hover-nested": { |
| 2000 | + "source": "main { p:hover { color: red; } }", |
| 2001 | + "generate": "main{p:hover{color:red}}", |
| 2002 | + "ast": { |
| 2003 | + "type": "Rule", |
| 2004 | + "prelude": { |
| 2005 | + "type": "SelectorList", |
| 2006 | + "children": [ |
| 2007 | + { |
| 2008 | + "type": "Selector", |
| 2009 | + "children": [ |
| 2010 | + { |
| 2011 | + "type": "TypeSelector", |
| 2012 | + "name": "main" |
| 2013 | + } |
| 2014 | + ] |
| 2015 | + } |
| 2016 | + ] |
| 2017 | + }, |
| 2018 | + "block": { |
| 2019 | + "type": "Block", |
| 2020 | + "children": [ |
| 2021 | + { |
| 2022 | + "type": "Rule", |
| 2023 | + "prelude": { |
| 2024 | + "type": "SelectorList", |
| 2025 | + "children": [ |
| 2026 | + { |
| 2027 | + "type": "Selector", |
| 2028 | + "children": [ |
| 2029 | + { |
| 2030 | + "type": "TypeSelector", |
| 2031 | + "name": "p" |
| 2032 | + }, |
| 2033 | + { |
| 2034 | + "type": "PseudoClassSelector", |
| 2035 | + "name": "hover", |
| 2036 | + "children": null |
| 2037 | + } |
| 2038 | + ] |
| 2039 | + } |
| 2040 | + ] |
| 2041 | + }, |
| 2042 | + "block": { |
| 2043 | + "type": "Block", |
| 2044 | + "children": [ |
| 2045 | + { |
| 2046 | + "type": "Declaration", |
| 2047 | + "important": false, |
| 2048 | + "property": "color", |
| 2049 | + "value": { |
| 2050 | + "type": "Value", |
| 2051 | + "children": [ |
| 2052 | + { |
| 2053 | + "type": "Identifier", |
| 2054 | + "name": "red" |
| 2055 | + } |
| 2056 | + ] |
| 2057 | + } |
| 2058 | + } |
| 2059 | + ] |
| 2060 | + } |
| 2061 | + } |
| 2062 | + ] |
| 2063 | + } |
| 2064 | + } |
| 2065 | + }, |
| 2066 | + "element-nested-simple": { |
| 2067 | + "source": "main { div { margin: 10px; } }", |
| 2068 | + "generate": "main{div{margin:10px}}", |
| 2069 | + "ast": { |
| 2070 | + "type": "Rule", |
| 2071 | + "prelude": { |
| 2072 | + "type": "SelectorList", |
| 2073 | + "children": [ |
| 2074 | + { |
| 2075 | + "type": "Selector", |
| 2076 | + "children": [ |
| 2077 | + { |
| 2078 | + "type": "TypeSelector", |
| 2079 | + "name": "main" |
| 2080 | + } |
| 2081 | + ] |
| 2082 | + } |
| 2083 | + ] |
| 2084 | + }, |
| 2085 | + "block": { |
| 2086 | + "type": "Block", |
| 2087 | + "children": [ |
| 2088 | + { |
| 2089 | + "type": "Rule", |
| 2090 | + "prelude": { |
| 2091 | + "type": "SelectorList", |
| 2092 | + "children": [ |
| 2093 | + { |
| 2094 | + "type": "Selector", |
| 2095 | + "children": [ |
| 2096 | + { |
| 2097 | + "type": "TypeSelector", |
| 2098 | + "name": "div" |
| 2099 | + } |
| 2100 | + ] |
| 2101 | + } |
| 2102 | + ] |
| 2103 | + }, |
| 2104 | + "block": { |
| 2105 | + "type": "Block", |
| 2106 | + "children": [ |
| 2107 | + { |
| 2108 | + "type": "Declaration", |
| 2109 | + "important": false, |
| 2110 | + "property": "margin", |
| 2111 | + "value": { |
| 2112 | + "type": "Value", |
| 2113 | + "children": [ |
| 2114 | + { |
| 2115 | + "type": "Dimension", |
| 2116 | + "value": "10", |
| 2117 | + "unit": "px" |
| 2118 | + } |
| 2119 | + ] |
| 2120 | + } |
| 2121 | + } |
| 2122 | + ] |
| 2123 | + } |
| 2124 | + } |
| 2125 | + ] |
| 2126 | + } |
| 2127 | + } |
| 2128 | + }, |
| 2129 | + "multiple-nested-selectors": { |
| 2130 | + "source": "main { p:hover { color: red; } div { margin: 10px; } .button { padding: 5px; } }", |
| 2131 | + "generate": "main{p:hover{color:red}div{margin:10px}.button{padding:5px}}", |
| 2132 | + "ast": { |
| 2133 | + "type": "Rule", |
| 2134 | + "prelude": { |
| 2135 | + "type": "SelectorList", |
| 2136 | + "children": [ |
| 2137 | + { |
| 2138 | + "type": "Selector", |
| 2139 | + "children": [ |
| 2140 | + { |
| 2141 | + "type": "TypeSelector", |
| 2142 | + "name": "main" |
| 2143 | + } |
| 2144 | + ] |
| 2145 | + } |
| 2146 | + ] |
| 2147 | + }, |
| 2148 | + "block": { |
| 2149 | + "type": "Block", |
| 2150 | + "children": [ |
| 2151 | + { |
| 2152 | + "type": "Rule", |
| 2153 | + "prelude": { |
| 2154 | + "type": "SelectorList", |
| 2155 | + "children": [ |
| 2156 | + { |
| 2157 | + "type": "Selector", |
| 2158 | + "children": [ |
| 2159 | + { |
| 2160 | + "type": "TypeSelector", |
| 2161 | + "name": "p" |
| 2162 | + }, |
| 2163 | + { |
| 2164 | + "type": "PseudoClassSelector", |
| 2165 | + "name": "hover", |
| 2166 | + "children": null |
| 2167 | + } |
| 2168 | + ] |
| 2169 | + } |
| 2170 | + ] |
| 2171 | + }, |
| 2172 | + "block": { |
| 2173 | + "type": "Block", |
| 2174 | + "children": [ |
| 2175 | + { |
| 2176 | + "type": "Declaration", |
| 2177 | + "important": false, |
| 2178 | + "property": "color", |
| 2179 | + "value": { |
| 2180 | + "type": "Value", |
| 2181 | + "children": [ |
| 2182 | + { |
| 2183 | + "type": "Identifier", |
| 2184 | + "name": "red" |
| 2185 | + } |
| 2186 | + ] |
| 2187 | + } |
| 2188 | + } |
| 2189 | + ] |
| 2190 | + } |
| 2191 | + }, |
| 2192 | + { |
| 2193 | + "type": "Rule", |
| 2194 | + "prelude": { |
| 2195 | + "type": "SelectorList", |
| 2196 | + "children": [ |
| 2197 | + { |
| 2198 | + "type": "Selector", |
| 2199 | + "children": [ |
| 2200 | + { |
| 2201 | + "type": "TypeSelector", |
| 2202 | + "name": "div" |
| 2203 | + } |
| 2204 | + ] |
| 2205 | + } |
| 2206 | + ] |
| 2207 | + }, |
| 2208 | + "block": { |
| 2209 | + "type": "Block", |
| 2210 | + "children": [ |
| 2211 | + { |
| 2212 | + "type": "Declaration", |
| 2213 | + "important": false, |
| 2214 | + "property": "margin", |
| 2215 | + "value": { |
| 2216 | + "type": "Value", |
| 2217 | + "children": [ |
| 2218 | + { |
| 2219 | + "type": "Dimension", |
| 2220 | + "value": "10", |
| 2221 | + "unit": "px" |
| 2222 | + } |
| 2223 | + ] |
| 2224 | + } |
| 2225 | + } |
| 2226 | + ] |
| 2227 | + } |
| 2228 | + }, |
| 2229 | + { |
| 2230 | + "type": "Rule", |
| 2231 | + "prelude": { |
| 2232 | + "type": "SelectorList", |
| 2233 | + "children": [ |
| 2234 | + { |
| 2235 | + "type": "Selector", |
| 2236 | + "children": [ |
| 2237 | + { |
| 2238 | + "type": "ClassSelector", |
| 2239 | + "name": "button" |
| 2240 | + } |
| 2241 | + ] |
| 2242 | + } |
| 2243 | + ] |
| 2244 | + }, |
| 2245 | + "block": { |
| 2246 | + "type": "Block", |
| 2247 | + "children": [ |
| 2248 | + { |
| 2249 | + "type": "Declaration", |
| 2250 | + "important": false, |
| 2251 | + "property": "padding", |
| 2252 | + "value": { |
| 2253 | + "type": "Value", |
| 2254 | + "children": [ |
| 2255 | + { |
| 2256 | + "type": "Dimension", |
| 2257 | + "value": "5", |
| 2258 | + "unit": "px" |
| 2259 | + } |
| 2260 | + ] |
| 2261 | + } |
| 2262 | + } |
| 2263 | + ] |
| 2264 | + } |
| 2265 | + } |
| 2266 | + ] |
| 2267 | + } |
| 2268 | + } |
1931 | 2269 | } |
1932 | 2270 | } |
0 commit comments