1<===> upstream/input.scss 2@use "other"; 3 4in-input {@extend in-other} 5 6<===> upstream/_other.scss 7in-other {x: y} 8 9<===> upstream/output.css 10in-other, in-input { 11 x: y; 12} 13 14<===> 15================================================================================ 16<===> far_upstream/input.scss 17@use "midstream"; 18 19in-input {@extend in-upstream} 20 21<===> far_upstream/_midstream.scss 22@use "upstream"; 23 24<===> far_upstream/_upstream.scss 25in-upstream {x: y} 26 27<===> far_upstream/output.css 28in-upstream, in-input { 29 x: y; 30} 31 32<===> 33================================================================================ 34<===> placeholder/input.scss 35@use "other"; 36 37in-input {@extend %in-other} 38 39<===> placeholder/_other.scss 40%in-other {x: y} 41 42<===> placeholder/output.css 43in-input { 44 x: y; 45} 46 47<===> 48================================================================================ 49<===> midstream_extend_within_pseudoselector/is/options.yml 50--- 51:todo: 52- sass/dart-sass#1297 53 54<===> midstream_extend_within_pseudoselector/is/input.scss 55@use "midstream"; 56in-input { 57 @extend in-midstream; 58 y: z; 59} 60 61<===> midstream_extend_within_pseudoselector/is/_midstream.scss 62@use "upstream"; 63:is(in-midstream) {@extend in-upstream} 64 65<===> midstream_extend_within_pseudoselector/is/_upstream.scss 66in-upstream {a: b} 67 68<===> midstream_extend_within_pseudoselector/is/output.css 69in-upstream, :is(in-midstream, in-input) { 70 a: b; 71} 72 73in-input { 74 y: z; 75} 76 77<===> 78================================================================================ 79<===> midstream_extend_within_pseudoselector/matches/options.yml 80--- 81:todo: 82- sass/dart-sass#1297 83 84<===> midstream_extend_within_pseudoselector/matches/input.scss 85@use "midstream"; 86in-input { 87 @extend in-midstream; 88 y: z; 89} 90 91<===> midstream_extend_within_pseudoselector/matches/_midstream.scss 92@use "upstream"; 93:matches(in-midstream) {@extend in-upstream} 94 95<===> midstream_extend_within_pseudoselector/matches/_upstream.scss 96in-upstream {a: b} 97 98<===> midstream_extend_within_pseudoselector/matches/output.css 99in-upstream, :matches(in-midstream, in-input) { 100 a: b; 101} 102 103in-input { 104 y: z; 105} 106 107<===> 108================================================================================ 109<===> diamond_merge/input.scss 110// Sibling modules can't extend one another's selectors, but they can be merged 111// together into the same selector list if they extend the same thing. If they 112// are, they should be optimized with respect to one another. 113// 114// In this case, _left.scss causes the selector ".a.a" to be generated, which is 115// simplified to ".a". Then _right.scss causes ".a.b" to be generated. ".a" is a 116// superselector of ".a.b" and ".a" has the same specificity as the extender, 117// ".b", so ".a.b" can (and should) be optimized away. 118@use "left"; 119@use "right"; 120 121<===> diamond_merge/_left.scss 122@use "other"; 123 124.a {@extend %in-other} 125 126<===> diamond_merge/_right.scss 127@use "other"; 128 129.b {@extend %in-other} 130 131<===> diamond_merge/_other.scss 132%in-other.a {x: y} 133 134<===> diamond_merge/output.css 135.a { 136 x: y; 137} 138 139<===> 140================================================================================ 141<===> diamond_dependency/with_midstream_extend/input.scss 142@use "left"; 143@use "right"; 144 145<===> diamond_dependency/with_midstream_extend/_left.scss 146@use "midstream"; 147in-left { 148 @extend in-midstream; 149 w: x; 150} 151 152<===> diamond_dependency/with_midstream_extend/_right.scss 153@use "midstream"; 154in-right { 155 @extend in-midstream; 156 y: z; 157} 158 159<===> diamond_dependency/with_midstream_extend/_midstream.scss 160@use "upstream"; 161in-midstream {@extend in-upstream} 162 163<===> diamond_dependency/with_midstream_extend/_upstream.scss 164in-upstream {a: b} 165 166<===> diamond_dependency/with_midstream_extend/output.css 167in-upstream, in-midstream, in-right, in-left { 168 a: b; 169} 170 171in-left { 172 w: x; 173} 174 175in-right { 176 y: z; 177} 178 179<===> 180================================================================================ 181<===> extended/from_same_file/input.scss 182@use "other"; 183 184in-input {@extend in-other-extender} 185 186<===> extended/from_same_file/_other.scss 187in-other-extender {@extend in-other-extendee} 188 189in-other-extendee {x: y} 190 191<===> extended/from_same_file/output.css 192in-other-extendee, in-other-extender, in-input { 193 x: y; 194} 195 196<===> 197================================================================================ 198<===> extended/from_other_file/input.scss 199@use "midstream"; 200 201in-input {@extend in-midstream} 202 203<===> extended/from_other_file/_midstream.scss 204@use "upstream"; 205 206in-midstream {@extend in-upstream} 207 208<===> extended/from_other_file/_upstream.scss 209in-upstream {x: y} 210 211<===> extended/from_other_file/output.css 212in-upstream, in-midstream, in-input { 213 x: y; 214} 215 216<===> 217================================================================================ 218<===> optional_and_mandatory/README.md 219If an optional and a mandatory version of the same extension both exist, the 220mandatory version should be marked as having successfully matched. 221 222<===> 223================================================================================ 224<===> optional_and_mandatory/same_file/input.scss 225@use "other"; 226 227in-input { 228 @extend in-other !optional; 229 @extend in-other; 230} 231 232<===> optional_and_mandatory/same_file/_other.scss 233in-other {x: y} 234 235<===> optional_and_mandatory/same_file/output.css 236in-other, in-input { 237 x: y; 238} 239 240<===> 241================================================================================ 242<===> optional_and_mandatory/different_files/input.scss 243@use "optional"; 244@use "mandatory"; 245 246<===> optional_and_mandatory/different_files/_optional.scss 247@use "shared"; 248 249downstream {@extend in-other !optional}; 250 251<===> optional_and_mandatory/different_files/_mandatory.scss 252@use "shared"; 253 254downstream {@extend in-other}; 255 256<===> optional_and_mandatory/different_files/_shared.scss 257in-other {x: y} 258 259<===> optional_and_mandatory/different_files/output.css 260in-other, downstream { 261 x: y; 262} 263 264<===> 265================================================================================ 266<===> scope/README.md 267All tests in this directory use `!optional` extends to test extensions that 268don't have matches. Each test should have a counterpart in error/extend/ that 269tests the same thing but without `!optional` to verify that it properly produces 270an error message. 271 272<===> 273================================================================================ 274<===> scope/sibling/input.scss 275@use "left"; 276@use "right"; 277 278<===> scope/sibling/_left.scss 279left-extendee {in: left} 280left-extender {@extend right-extendee !optional} 281 282<===> scope/sibling/_right.scss 283right-extendee {in: right} 284right-extender {@extend left-extendee !optional} 285 286<===> scope/sibling/output.css 287left-extendee { 288 in: left; 289} 290 291right-extendee { 292 in: right; 293} 294 295<===> 296================================================================================ 297<===> scope/downstream/input.scss 298@use "other"; 299 300in-input {x: y} 301 302<===> scope/downstream/_other.scss 303in-other {@extend in-input !optional} 304 305<===> scope/downstream/output.css 306in-input { 307 x: y; 308} 309 310<===> 311================================================================================ 312<===> scope/private/input.scss 313@use "other"; 314 315in-input {@extend %-in-other !optional} 316 317<===> scope/private/_other.scss 318%-in-other {x: y} 319 320in-other {@extend %-in-other} 321 322<===> scope/private/output.css 323in-other { 324 x: y; 325} 326 327<===> 328================================================================================ 329<===> scope/diamond/input.scss 330// Even though left-extendee and right-extendee both end up in the style rule 331// defined in _shared.scss, they aren't extended by the other file because those 332// files don't use one another. 333@use "left"; 334@use "right"; 335 336<===> scope/diamond/_left.scss 337@use "shared"; 338 339left-extendee {@extend in-shared} 340left-extender {@extend right-extendee !optional} 341 342<===> scope/diamond/_right.scss 343@use "shared"; 344 345right-extendee {@extend in-shared} 346right-extender {@extend left-extendee !optional} 347 348<===> scope/diamond/_shared.scss 349in-shared {x: y} 350 351<===> scope/diamond/output.css 352in-shared, right-extendee, left-extendee { 353 x: y; 354} 355 356<===> 357================================================================================ 358<===> scope/use_into_use_and_import_into_use/input.scss 359@use "used"; 360@import "imported"; 361 362<===> scope/use_into_use_and_import_into_use/_used.scss 363@use "shared"; 364 365in-used {@extend shared} 366 367<===> scope/use_into_use_and_import_into_use/_imported.scss 368@use "shared"; 369 370in-imported {@extend shared} 371 372<===> scope/use_into_use_and_import_into_use/_shared.scss 373// When this module is used by _imported.scss, its CSS is copied. The used 374// @extend only applies to the original, while the imported @extend applies to 375// both (since the imported extend is downstream of the used module). 376 377shared {x: y} 378 379<===> scope/use_into_use_and_import_into_use/output.css 380shared, in-used, in-imported { 381 x: y; 382} 383 384shared, in-imported { 385 x: y; 386} 387 388<===> 389================================================================================ 390<===> scope/use_into_use_and_import_into_import/input.scss 391@use "used"; 392@import "imported"; 393 394<===> scope/use_into_use_and_import_into_import/_used.scss 395@use "shared"; 396 397in-used {@extend shared} 398 399<===> scope/use_into_use_and_import_into_import/_imported.scss 400@import "shared"; 401 402in-imported {@extend shared} 403 404<===> scope/use_into_use_and_import_into_import/_shared.scss 405// When this module is used by _imported.scss, its CSS is copied. The used 406// @extend only applies to the original, while the imported @extend applies to 407// both (since the imported extend is downstream of the used module). 408shared {x: y} 409 410<===> scope/use_into_use_and_import_into_import/output.css 411shared, in-used, in-imported { 412 x: y; 413} 414 415shared, in-imported { 416 x: y; 417} 418 419<===> 420================================================================================ 421<===> scope/use_into_use_and_use_into_import/input.scss 422@use "user"; 423@use "importer"; 424 425<===> scope/use_into_use_and_use_into_import/_user.scss 426@use "shared"; 427 428in-user {@extend shared} 429 430<===> scope/use_into_use_and_use_into_import/_importer.scss 431@import "shared"; 432 433in-importer {@extend shared} 434 435<===> scope/use_into_use_and_use_into_import/_shared.scss 436// When this module is imported by _importer.scss, its CSS is copied. The 437// imported @extend only applies to the copy, and the used @extend only applies 438// to the original. 439shared {x: y} 440 441<===> scope/use_into_use_and_use_into_import/output.css 442shared, in-user { 443 x: y; 444} 445 446shared, in-importer { 447 x: y; 448} 449 450<===> 451================================================================================ 452<===> scope/use_into_use_and_use_into_import_into_use/input.scss 453@use "importer"; 454@use "used"; 455 456<===> scope/use_into_use_and_use_into_import_into_use/_importer.scss 457@import "imported"; 458 459<===> scope/use_into_use_and_use_into_import_into_use/_imported.scss 460@use "shared"; 461 462in-imported {@extend shared} 463 464<===> scope/use_into_use_and_use_into_import_into_use/_used.scss 465@use "shared"; 466 467in-used {@extend shared} 468 469<===> scope/use_into_use_and_use_into_import_into_use/_shared.scss 470// When this module is used by _imported.scss, its CSS is copied. The imported 471// @extend only applies to the copy, and the used @extend only applies to the 472// original. 473shared {x: y} 474 475<===> scope/use_into_use_and_use_into_import_into_use/output.css 476shared, in-imported { 477 x: y; 478} 479 480shared, in-used { 481 x: y; 482} 483 484<===> 485================================================================================ 486<===> scope/use_and_import_into_diamond_extend/input.scss 487@use "downstream"; 488@import "downstream"; 489@import "imported"; 490 491<===> scope/use_and_import_into_diamond_extend/_downstream.scss 492// Even though left-extendee and right-extendee both end up in the style rule 493// defined in _shared.scss, they aren't extended by the other file because those 494// files don't use one another. This is true even though they're imported, which 495// eagerly resolves extensions. 496@use "left"; 497@use "right"; 498 499<===> scope/use_and_import_into_diamond_extend/_left.scss 500@use "shared"; 501 502left-extendee {@extend in-shared} 503left-extender {@extend right-extendee !optional} 504 505<===> scope/use_and_import_into_diamond_extend/_right.scss 506@use "shared"; 507 508right-extendee {@extend in-shared} 509right-extender {@extend left-extendee !optional} 510 511<===> scope/use_and_import_into_diamond_extend/_shared.scss 512in-shared {x: y} 513 514<===> scope/use_and_import_into_diamond_extend/_imported.scss 515@use "downstream"; 516 517<===> scope/use_and_import_into_diamond_extend/output.css 518in-shared, right-extendee, left-extendee { 519 x: y; 520} 521 522in-shared, right-extendee, left-extendee { 523 x: y; 524} 525 526in-shared, right-extendee, left-extendee { 527 x: y; 528} 529 530<===> 531================================================================================ 532<===> scope/isolated_through_import/input.scss 533@use "used-by-input"; 534@import "imported"; 535 536<===> scope/isolated_through_import/_used-by-input.scss 537@use "shared"; 538 539.in-used-by-input {@extend .in-shared} 540 541<===> scope/isolated_through_import/_imported.scss 542@use "used-by-imported"; 543 544<===> scope/isolated_through_import/_used-by-imported.scss 545@use "shared"; 546 547.in-used-by-imported {@extend .in-shared} 548 549<===> scope/isolated_through_import/_shared.scss 550// This should appear twice in the output: once when it's used directly, and 551// once when it's used through @import (since @import copies its CSS). Each copy 552// should be extended exactly once. 553.in-shared {a: b} 554 555<===> scope/isolated_through_import/output.css 556.in-shared, .in-used-by-input { 557 a: b; 558} 559 560.in-shared, .in-used-by-imported { 561 a: b; 562} 563