import-reference-issues.less 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // Tests following past issues:
  2. // * #1851 - Extend within (reference) imported files
  3. // * #1896 - Namespace imported less code does not get properly referenced, when there's a (reference) keyword.
  4. // * #1878 - extend inside referenced file should not extend outside selectors
  5. // * #2716 - A file imported by reference and then normally - multiple imports should be independent
  6. // * #1968 - When using an @import (reference), mixins that contain an & selector get added to the compiled output improperly
  7. // * #2162 - Cannot put import by reference inside of a mixin (also doubles #1896)
  8. // #1878: extend inside referenced file should not extend outside selectors
  9. @import (reference) "import-reference-issues/global-scope-import.less";
  10. .theOnlySelector {
  11. shall-have: one selector;
  12. }
  13. // #2716: A file imported by reference and then normally - multiple imports should be independent
  14. // #1878: - double nested version
  15. #do-not-show-import {
  16. @import (reference, multiple) "import-reference-issues/multiple-import.less";
  17. }
  18. show-all-content {
  19. @import (multiple) "import-reference-issues/multiple-import.less";
  20. }
  21. // #1896: Namespace imported less code does not get properly referenced, when there's a (reference) keyword.
  22. #Namespace {
  23. @import (less, reference) "import-reference-issues/simple-mixin.css";
  24. }
  25. #used-namespaced-mixin {
  26. #Namespace > .mixin();
  27. shall-see: another property above;
  28. }
  29. // #1851: Extend within (reference) imported files
  30. // test-b is in global-scope-import.less file
  31. .test-c {
  32. &:extend(.test-b all);
  33. }
  34. // #1968: When using an @import (reference), mixins that contain an & selector get added to the compiled output improperly
  35. @import "import-reference-issues/mixin-1968.less";
  36. @import (reference) "import-reference-issues/appender-reference-1968.less";
  37. // #2162 - Cannot put import by reference inside of a mixin (also doubles #1896)
  38. .mixin-with-import-by-reference-inside() {
  39. the-only-property: nothing-below-this;
  40. @import (reference) "import-reference-issues/simple-ruleset-2162.less";
  41. }
  42. call-mixin-with-import-by-reference-inside {
  43. .mixin-with-import-by-reference-inside();
  44. }