_dropdown.scss 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. // =============================================================================
  2. // Listing view smaller dropdowns
  3. // =============================================================================
  4. // .c-dropdown {
  5. // }
  6. .c-dropdown__button {
  7. display: inline-block;
  8. box-sizing: border-box;
  9. padding-inline-start: 0.5rem;
  10. padding-inline-end: 0.25rem;
  11. // Make this the same as the other buttons
  12. line-height: 1.85;
  13. border: solid 1px transparent;
  14. border-radius: 2px;
  15. font-size: 0.95em;
  16. cursor: pointer;
  17. -webkit-font-smoothing: subpixel-antialiased;
  18. user-select: none;
  19. }
  20. .c-dropdown--large .c-dropdown__button {
  21. line-height: 2.9em;
  22. padding-inline-start: 0.5rem;
  23. padding-inline-end: 0.5rem;
  24. .icon-site {
  25. padding-inline-end: 0.2rem;
  26. }
  27. }
  28. .c-dropdown__icon {
  29. padding-inline-start: 0.4rem;
  30. padding-inline-end: 0.4rem;
  31. }
  32. .c-dropdown__toggle {
  33. display: inline-block;
  34. }
  35. .c-dropdown__togle--icon {
  36. &:before {
  37. display: none; // TODO: remove when iconfont styles are removed
  38. }
  39. .icon {
  40. @include svg-icon(1em, middle);
  41. }
  42. .icon-arrow-up {
  43. display: none;
  44. }
  45. }
  46. .is-open .c-dropdown__togle--icon {
  47. .icon-arrow-up {
  48. display: inline-block;
  49. }
  50. .icon-arrow-down {
  51. display: none;
  52. }
  53. }
  54. .c-dropdown__menu.c-dropdown__menu {
  55. margin-top: 0.75rem;
  56. padding: 0.75rem 1rem;
  57. min-width: 8rem;
  58. text-transform: none;
  59. position: absolute;
  60. z-index: 1000;
  61. animation: dropdownIn 0.1s ease-out backwards;
  62. list-style: none;
  63. // Override any right alignment that might've been set by a parent element
  64. // (such as the snippets header)
  65. text-align: start;
  66. }
  67. .c-dropdown__item {
  68. margin-bottom: 0.375rem;
  69. font-size: 0.8rem;
  70. &:hover {
  71. .c-dropdown__indicator {
  72. opacity: 0.6;
  73. }
  74. }
  75. }
  76. .c-dropdown__item:last-child {
  77. margin-bottom: 0;
  78. }
  79. .c-dropdown__divider {
  80. border-color: #555;
  81. border-style: dotted;
  82. margin-top: 12px;
  83. margin-bottom: 12px;
  84. }
  85. @keyframes dropdownIn {
  86. 0% {
  87. opacity: 0;
  88. }
  89. 100% {
  90. opacity: 1;
  91. }
  92. }