|
1 | 1 | /* generate from test/specs/shorthand.spec.ts */
|
2 | 2 | import { expect as f } from '../../node_modules/@esm-bundle/chai/esm/chai.js';
|
3 | 3 | import { transform } from '../../dist/node/index.js';
|
| 4 | +import {render} from "../../dist/index.js"; |
4 | 5 |
|
5 | 6 | const options = {
|
6 | 7 | minify: true,
|
@@ -234,4 +235,83 @@ border: #333 solid 1px;
|
234 | 235 | }
|
235 | 236 | `, options).then(result => f(result.code).equals('html{font:clamp(12px,.8rem + .25vw,20px)/1.7 Blanco,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"}'));
|
236 | 237 | });
|
| 238 | + |
| 239 | + it('shorthand parsing #16', function () { |
| 240 | + return transform(` |
| 241 | +@media all { |
| 242 | + html { |
| 243 | + font-family: Blanco, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; |
| 244 | + font-size: clamp(12px, 0.8rem + 0.25vw, 20px); |
| 245 | + font-weight: 400; |
| 246 | + line-height: 1.7; |
| 247 | + } |
| 248 | +} |
| 249 | +
|
| 250 | +button.jetpack-instant-search__overlay-close { |
| 251 | + align-items: center; |
| 252 | + appearance: none; |
| 253 | + background-image: none; |
| 254 | + background-position: initial; |
| 255 | + background-size: initial; |
| 256 | + background-repeat: initial; |
| 257 | + background-attachment: initial; |
| 258 | + background-origin: initial; |
| 259 | + background-clip: initial; |
| 260 | + border-top: none; |
| 261 | + border-right: none; |
| 262 | + border-left: none; |
| 263 | + border-image: initial; |
| 264 | + border-bottom: 1px solid rgb(230, 241, 245); |
| 265 | + border-radius: 0px; |
| 266 | + box-shadow: none; |
| 267 | + cursor: pointer; |
| 268 | + display: flex; |
| 269 | + height: 61px; |
| 270 | + justify-content: center; |
| 271 | + line-height: 1; |
| 272 | + margin: 0px; |
| 273 | + outline: none; |
| 274 | + padding: 0px; |
| 275 | + text-decoration: none; |
| 276 | + text-shadow: none; |
| 277 | + text-transform: none; |
| 278 | + width: 60px; |
| 279 | + background-color: transparent !important; |
| 280 | +} |
| 281 | +
|
| 282 | +`, options).then(result => f(render(result.ast, {minify: false}).code).equals(`html { |
| 283 | + font: clamp(12px,.8rem + .25vw,20px)/1.7 Blanco,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol" |
| 284 | +} |
| 285 | +button.jetpack-instant-search__overlay-close { |
| 286 | + align-items: center; |
| 287 | + appearance: none; |
| 288 | + background-image: none; |
| 289 | + background-position: initial; |
| 290 | + background-size: initial; |
| 291 | + background-repeat: initial; |
| 292 | + background-attachment: initial; |
| 293 | + background-origin: initial; |
| 294 | + background-clip: initial; |
| 295 | + background-color: #0000 !important; |
| 296 | + border-top: none; |
| 297 | + border-right: none; |
| 298 | + border-left: none; |
| 299 | + border-image: initial; |
| 300 | + border-bottom: 1px solid #e6f1f5; |
| 301 | + border-radius: 0; |
| 302 | + box-shadow: none; |
| 303 | + cursor: pointer; |
| 304 | + display: flex; |
| 305 | + height: 61px; |
| 306 | + justify-content: center; |
| 307 | + line-height: 1; |
| 308 | + margin: 0; |
| 309 | + outline: none; |
| 310 | + padding: 0; |
| 311 | + text-decoration: none; |
| 312 | + text-shadow: none; |
| 313 | + text-transform: none; |
| 314 | + width: 60px |
| 315 | +}`)); |
| 316 | + }); |
237 | 317 | });
|
0 commit comments