link.scss 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. @use 'sass:map';
  2. @use 'mixins/mixins' as *;
  3. @use 'mixins/var' as *;
  4. @use 'mixins/utils' as *;
  5. @use 'common/var' as *;
  6. @include b(link) {
  7. @include set-component-css-var('link', $link);
  8. }
  9. @include b(link) {
  10. display: inline-flex;
  11. flex-direction: row;
  12. align-items: center;
  13. justify-content: center;
  14. vertical-align: middle;
  15. position: relative;
  16. text-decoration: none;
  17. outline: none;
  18. cursor: pointer;
  19. padding: 0;
  20. font-size: getCssVar('link', 'font-size');
  21. font-weight: getCssVar('link', 'font-weight');
  22. color: getCssVar('link', 'text-color');
  23. &:hover {
  24. color: getCssVar('link', 'hover-text-color');
  25. }
  26. @include when(underline) {
  27. &:hover:after {
  28. content: '';
  29. position: absolute;
  30. left: 0;
  31. right: 0;
  32. height: 0;
  33. bottom: 0;
  34. border-bottom: 1px solid getCssVar('link', 'hover-text-color');
  35. }
  36. }
  37. @include when(disabled) {
  38. color: getCssVar('link', 'disabled-text-color');
  39. cursor: not-allowed;
  40. }
  41. & [class*='#{$namespace}-icon-'] {
  42. & + span {
  43. margin-left: 5px;
  44. }
  45. }
  46. &.#{$namespace}-link--default {
  47. &:after {
  48. border-color: getCssVar('link', 'hover-text-color');
  49. }
  50. }
  51. @include e(inner) {
  52. display: inline-flex;
  53. justify-content: center;
  54. align-items: center;
  55. }
  56. @each $type in $types {
  57. &.#{$namespace}-link--#{$type} {
  58. @include css-var-from-global(('link', 'text-color'), ('color', $type));
  59. @include css-var-from-global(
  60. ('link', 'hover-text-color'),
  61. ('color', $type, 'light-3')
  62. );
  63. @include css-var-from-global(
  64. ('link', 'disabled-text-color'),
  65. ('color', $type, 'light-5')
  66. );
  67. &:after {
  68. border-color: getCssVar('link', 'text-color');
  69. }
  70. @include when(underline) {
  71. &:hover:after {
  72. border-color: getCssVar('link', 'text-color');
  73. }
  74. }
  75. }
  76. }
  77. }