You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

84 lines
1.4 KiB

4 years ago
  1. .collapsable-code {
  2. --border-color: color-mod(var(--accent) blend(#999 90%));
  3. position: relative;
  4. width: 100%;
  5. margin: 40px 0;
  6. input[type="checkbox"] {
  7. position: absolute;
  8. visibility: hidden;
  9. }
  10. input[type="checkbox"]:checked {
  11. ~ pre,
  12. ~ .code-toolbar pre {
  13. height: 0;
  14. padding: 0;
  15. border-top: none;
  16. }
  17. ~ .code-toolbar {
  18. padding: 0;
  19. border-top: none;
  20. .toolbar {
  21. display: none;
  22. }
  23. }
  24. ~ label .collapsable-code__toggle:after {
  25. content: attr(data-label-expand);
  26. }
  27. }
  28. label {
  29. position: relative;
  30. display: flex;
  31. justify-content: space-between;
  32. min-width: 30px;
  33. min-height: 30px;
  34. margin: 0;
  35. border-bottom: 1px solid var(--border-color);
  36. cursor: pointer;
  37. }
  38. &__title {
  39. flex: 1;
  40. color: var(--accent);
  41. padding: 3px 10px;
  42. text-overflow: ellipsis;
  43. white-space: nowrap;
  44. overflow: hidden;
  45. }
  46. &__language {
  47. color: var(--accent);
  48. border: 1px solid var(--border-color);
  49. border-bottom: none;
  50. text-transform: uppercase;
  51. padding: 3px 10px;
  52. }
  53. &__toggle {
  54. color: var(--accent);
  55. font-size: 16px;
  56. padding: 3px 10px;
  57. &:after {
  58. content: attr(data-label-collapse);
  59. }
  60. }
  61. pre {
  62. margin-top: 0;
  63. &::first-line {
  64. line-height: 0;
  65. }
  66. }
  67. .code-toolbar {
  68. margin: 0;
  69. }
  70. }