code.less 922 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. @import "../generated/pygments.less";
  2. .codelines {
  3. margin: @results-margin 0 0 0;
  4. padding: @result-padding 0 0 0;
  5. }
  6. .code-highlight-sxng() {
  7. .code-highlight {
  8. pre {
  9. overflow: auto;
  10. margin: 0;
  11. padding: 0 0 0.75rem 0;
  12. }
  13. .linenos {
  14. user-select: none;
  15. cursor: default;
  16. &::selection {
  17. background: transparent; /* WebKit/Blink Browsers */
  18. }
  19. &::-moz-selection {
  20. background: transparent; /* Gecko Browsers */
  21. }
  22. margin-right: 8px;
  23. text-align: right;
  24. }
  25. span.linenos {
  26. color: var(--color-line-number);
  27. }
  28. }
  29. }
  30. .code-highlight-sxng();
  31. /// Dark Theme (autoswitch based on device pref)
  32. @media (prefers-color-scheme: dark) {
  33. :root.theme-auto {
  34. .code-highlight-dark();
  35. .code-highlight-sxng();
  36. }
  37. }
  38. // Dark Theme by preferences
  39. :root.theme-dark {
  40. .code-highlight-dark();
  41. .code-highlight-sxng();
  42. }