radius.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _cssinjs = require("@ant-design/cssinjs");
  7. const genRadiusStyle = token => {
  8. const {
  9. componentCls,
  10. tableRadius
  11. } = token;
  12. return {
  13. [`${componentCls}-wrapper`]: {
  14. [componentCls]: {
  15. // https://github.com/ant-design/ant-design/issues/39115#issuecomment-1362314574
  16. [`${componentCls}-title, ${componentCls}-header`]: {
  17. borderRadius: `${(0, _cssinjs.unit)(tableRadius)} ${(0, _cssinjs.unit)(tableRadius)} 0 0`
  18. },
  19. [`${componentCls}-title + ${componentCls}-container`]: {
  20. borderStartStartRadius: 0,
  21. borderStartEndRadius: 0,
  22. // https://github.com/ant-design/ant-design/issues/41975
  23. [`${componentCls}-header, table`]: {
  24. borderRadius: 0
  25. },
  26. 'table > thead > tr:first-child': {
  27. 'th:first-child, th:last-child, td:first-child, td:last-child': {
  28. borderRadius: 0
  29. }
  30. }
  31. },
  32. '&-container': {
  33. borderStartStartRadius: tableRadius,
  34. borderStartEndRadius: tableRadius,
  35. 'table > thead > tr:first-child': {
  36. '> *:first-child': {
  37. borderStartStartRadius: tableRadius
  38. },
  39. '> *:last-child': {
  40. borderStartEndRadius: tableRadius
  41. }
  42. }
  43. },
  44. '&-footer': {
  45. borderRadius: `0 0 ${(0, _cssinjs.unit)(tableRadius)} ${(0, _cssinjs.unit)(tableRadius)}`
  46. }
  47. }
  48. }
  49. };
  50. };
  51. var _default = exports.default = genRadiusStyle;