index.module.scss 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. @use "../theme";
  2. .card {
  3. display: flex;
  4. flex-direction: column;
  5. gap: theme.spacing(1);
  6. border-radius: theme.border-radius("2xl");
  7. text-decoration: none;
  8. color: unset;
  9. outline-offset: 0;
  10. outline: theme.spacing(1) solid transparent;
  11. transition-property: outline-color, border-color, box-shadow, background;
  12. transition-duration: 100ms;
  13. transition-timing-function: linear;
  14. border: 1px solid transparent;
  15. position: relative;
  16. padding: theme.spacing(1);
  17. isolation: isolate;
  18. @at-root button#{&} {
  19. cursor: pointer;
  20. width: 100%;
  21. }
  22. .cardHoverBackground {
  23. border-radius: theme.border-radius("2xl");
  24. position: absolute;
  25. inset: -1px;
  26. opacity: 0;
  27. transition: opacity 100ms linear;
  28. background: theme.color("button", "outline", "background", "hover");
  29. z-index: -1;
  30. }
  31. .header {
  32. padding: theme.spacing(3) theme.spacing(4);
  33. position: relative;
  34. .title {
  35. margin: 0;
  36. font-size: theme.font-size("base");
  37. font-weight: theme.font-weight("medium");
  38. color: theme.color("heading");
  39. display: inline-flex;
  40. flex-flow: row nowrap;
  41. gap: theme.spacing(3);
  42. align-items: center;
  43. .icon {
  44. font-size: theme.spacing(6);
  45. height: theme.spacing(6);
  46. color: theme.color("button", "primary", "background", "normal");
  47. }
  48. }
  49. .toolbar {
  50. position: absolute;
  51. right: theme.spacing(3);
  52. top: 0;
  53. bottom: theme.spacing(0);
  54. display: flex;
  55. flex-flow: row nowrap;
  56. gap: theme.spacing(2);
  57. align-items: center;
  58. }
  59. }
  60. .footer {
  61. padding: theme.spacing(2);
  62. }
  63. &[data-variant="primary"] {
  64. background: theme.color("background", "card-highlight");
  65. &[data-hovered] {
  66. @include theme.elevation("primary", 2);
  67. }
  68. }
  69. &[data-variant="secondary"] {
  70. background: theme.color("background", "secondary");
  71. &[data-hovered] {
  72. @include theme.elevation("default", 2);
  73. }
  74. }
  75. &[data-variant="tertiary"] {
  76. background: theme.color("background", "primary");
  77. &[data-hovered] {
  78. @include theme.elevation("default", 2);
  79. }
  80. }
  81. &[data-hovered] .cardHoverBackground {
  82. opacity: 1;
  83. }
  84. &[data-focus-visible] {
  85. border-color: theme.color("focus");
  86. outline-color: theme.color("focus-dim");
  87. }
  88. }