2
0

_dropdown.scss 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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-left: 0.5rem;
  10. padding-right: 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-left: 0.5rem;
  23. padding-right: 0.5rem;
  24. .icon-site {
  25. padding-right: 0.2rem;
  26. }
  27. }
  28. .c-dropdown__toggle {
  29. display: inline-block;
  30. }
  31. .c-dropdown__togle--icon {
  32. &:before {
  33. display: none; // TODO: remove when iconfont styles are removed
  34. }
  35. .icon {
  36. @include svg-icon(1em, middle);
  37. }
  38. .icon-arrow-up {
  39. display: none;
  40. }
  41. }
  42. .is-open .c-dropdown__togle--icon {
  43. .icon-arrow-up {
  44. display: inline-block;
  45. }
  46. .icon-arrow-down {
  47. display: none;
  48. }
  49. }
  50. .c-dropdown__menu.c-dropdown__menu {
  51. margin-top: 0.75rem;
  52. padding: 0.75rem 1rem;
  53. min-width: 8rem;
  54. text-transform: none;
  55. position: absolute;
  56. z-index: 1000;
  57. animation: dropdownIn 0.1s ease-out backwards;
  58. list-style: none;
  59. // Override any right alignment that might've been set by a parent element
  60. // (such as the snippets header)
  61. text-align: left;
  62. }
  63. .c-dropdown__item {
  64. margin-bottom: 0.375rem;
  65. &:hover {
  66. .c-dropdown__indicator {
  67. opacity: 0.6;
  68. }
  69. }
  70. }
  71. .c-dropdown__item:last-child {
  72. margin-bottom: 0;
  73. }
  74. .c-dropdown__divider {
  75. border-color: #555;
  76. border-style: dotted;
  77. margin-top: 12px;
  78. margin-bottom: 12px;
  79. }
  80. @keyframes dropdownIn {
  81. 0% {
  82. opacity: 0;
  83. }
  84. 100% {
  85. opacity: 1;
  86. }
  87. }