Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 

43 rader
828 B

  1. import style from './style';
  2. import compose from './compose';
  3. function transform(value) {
  4. return value <= 1 ? `${value * 100}%` : value;
  5. }
  6. export const width = style({
  7. prop: 'width',
  8. transform
  9. });
  10. export const maxWidth = style({
  11. prop: 'maxWidth',
  12. transform
  13. });
  14. export const minWidth = style({
  15. prop: 'minWidth',
  16. transform
  17. });
  18. export const height = style({
  19. prop: 'height',
  20. transform
  21. });
  22. export const maxHeight = style({
  23. prop: 'maxHeight',
  24. transform
  25. });
  26. export const minHeight = style({
  27. prop: 'minHeight',
  28. transform
  29. });
  30. export const sizeWidth = style({
  31. prop: 'size',
  32. cssProperty: 'width',
  33. transform
  34. });
  35. export const sizeHeight = style({
  36. prop: 'size',
  37. cssProperty: 'height',
  38. transform
  39. });
  40. const sizing = compose(width, maxWidth, minWidth, height, maxHeight, minHeight);
  41. export default sizing;