compact-item-vertical.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. function compactItemVerticalBorder(token, parentCls, prefixCls) {
  2. return {
  3. // border collapse
  4. [`&-item:not(${parentCls}-last-item)`]: {
  5. marginBottom: token.calc(token.lineWidth).mul(-1).equal()
  6. },
  7. [`&-item:not(${prefixCls}-status-success)`]: {
  8. zIndex: 2
  9. },
  10. '&-item': {
  11. '&:hover,&:focus,&:active': {
  12. zIndex: 3
  13. },
  14. '&[disabled]': {
  15. zIndex: 0
  16. }
  17. }
  18. };
  19. }
  20. function compactItemBorderVerticalRadius(prefixCls, parentCls) {
  21. return {
  22. [`&-item:not(${parentCls}-first-item):not(${parentCls}-last-item)`]: {
  23. borderRadius: 0
  24. },
  25. [`&-item${parentCls}-first-item:not(${parentCls}-last-item)`]: {
  26. [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
  27. borderEndEndRadius: 0,
  28. borderEndStartRadius: 0
  29. }
  30. },
  31. [`&-item${parentCls}-last-item:not(${parentCls}-first-item)`]: {
  32. [`&, &${prefixCls}-sm, &${prefixCls}-lg`]: {
  33. borderStartStartRadius: 0,
  34. borderStartEndRadius: 0
  35. }
  36. }
  37. };
  38. }
  39. export function genCompactItemVerticalStyle(token) {
  40. const compactCls = `${token.componentCls}-compact-vertical`;
  41. return {
  42. [compactCls]: Object.assign(Object.assign({}, compactItemVerticalBorder(token, compactCls, token.componentCls)), compactItemBorderVerticalRadius(token.componentCls, compactCls))
  43. };
  44. }