radius.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. const genRadiusStyle = token => {
  2. const {
  3. componentCls,
  4. tableRadius
  5. } = token;
  6. return {
  7. [`${componentCls}-wrapper`]: {
  8. [componentCls]: {
  9. // https://github.com/ant-design/ant-design/issues/39115#issuecomment-1362314574
  10. [`${componentCls}-title, ${componentCls}-header`]: {
  11. borderRadius: `${tableRadius}px ${tableRadius}px 0 0`
  12. },
  13. [`${componentCls}-title + ${componentCls}-container`]: {
  14. borderStartStartRadius: 0,
  15. borderStartEndRadius: 0,
  16. table: {
  17. borderRadius: 0,
  18. '> thead > tr:first-child': {
  19. 'th:first-child': {
  20. borderRadius: 0
  21. },
  22. 'th:last-child': {
  23. borderRadius: 0
  24. }
  25. }
  26. }
  27. },
  28. '&-container': {
  29. borderStartStartRadius: tableRadius,
  30. borderStartEndRadius: tableRadius,
  31. 'table > thead > tr:first-child': {
  32. '> *:first-child': {
  33. borderStartStartRadius: tableRadius
  34. },
  35. '> *:last-child': {
  36. borderStartEndRadius: tableRadius
  37. }
  38. }
  39. },
  40. '&-footer': {
  41. borderRadius: `0 0 ${tableRadius}px ${tableRadius}px`
  42. }
  43. }
  44. }
  45. };
  46. };
  47. export default genRadiusStyle;