replace.test.scss 830 B

1234567891011121314151617181920212223242526272829303132333435
  1. @use '../custom-properties';
  2. @use '../theme';
  3. .simple {
  4. @include theme.property(width, 'calc(x - y)', $replace: (x: 100%, y: 20px));
  5. }
  6. .var {
  7. $first: custom-properties.create(--m-foo, 16px);
  8. $second: custom-properties.create(--m-bar, 8px);
  9. @include theme.property(
  10. width,
  11. 'calc(first + second)',
  12. $replace: (first: $first, second: $second)
  13. );
  14. @include theme.property(
  15. height,
  16. 'calc(first + second + first + second)',
  17. $replace: (first: $first, second: $second)
  18. );
  19. }
  20. .multiple {
  21. @include theme.property(width, 'calc(x + x + x)', $replace: (x: 8px));
  22. }
  23. .list {
  24. @include theme.property(padding, 0 value, $replace: (value: 16px));
  25. }
  26. .replace-nulls {
  27. // Entire block should be dropped. This should not be emitted.
  28. @include theme.property(padding, a b, $replace: (a: 16px, b: null));
  29. }