index.less 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. @import '../style/var';
  2. .van-grid-item {
  3. position: relative;
  4. box-sizing: border-box;
  5. &--square {
  6. height: 0;
  7. }
  8. &__icon {
  9. font-size: @grid-item-icon-size;
  10. }
  11. &__icon-wrapper {
  12. position: relative;
  13. }
  14. &__text {
  15. color: @grid-item-text-color;
  16. font-size: @grid-item-text-font-size;
  17. line-height: 1.5;
  18. // https://github.com/vant-ui/vant/issues/3894
  19. word-break: break-all;
  20. }
  21. &__icon + &__text {
  22. margin-top: @padding-xs;
  23. }
  24. &__content {
  25. display: flex;
  26. flex-direction: column;
  27. box-sizing: border-box;
  28. height: 100%;
  29. padding: @grid-item-content-padding;
  30. background-color: @grid-item-content-background-color;
  31. &::after {
  32. z-index: 1;
  33. border-width: 0 @border-width-base @border-width-base 0;
  34. }
  35. &--square {
  36. position: absolute;
  37. top: 0;
  38. right: 0;
  39. left: 0;
  40. }
  41. &--center {
  42. align-items: center;
  43. justify-content: center;
  44. }
  45. &--horizontal {
  46. flex-direction: row;
  47. .van-grid-item__icon + .van-grid-item__text {
  48. margin-top: 0;
  49. margin-left: @padding-xs;
  50. }
  51. }
  52. &--surround {
  53. &::after {
  54. border-width: @border-width-base;
  55. }
  56. }
  57. &--clickable {
  58. cursor: pointer;
  59. &:active {
  60. background-color: @grid-item-content-active-color;
  61. }
  62. }
  63. }
  64. }