James Peret's blog. Built with Jekyll and the Mikey theme.

prism-line-numbers.css 742B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. pre.line-numbers {
  2. position: relative;
  3. padding-left: 3.8em;
  4. counter-reset: linenumber;
  5. }
  6. pre.line-numbers > code {
  7. position: relative;
  8. }
  9. .line-numbers .line-numbers-rows {
  10. position: absolute;
  11. pointer-events: none;
  12. top: 0;
  13. font-size: 100%;
  14. left: -3.8em;
  15. width: 3em; /* works for line-numbers below 1000 lines */
  16. letter-spacing: -1px;
  17. border-right: 1px solid #999;
  18. -webkit-user-select: none;
  19. -moz-user-select: none;
  20. -ms-user-select: none;
  21. user-select: none;
  22. }
  23. .line-numbers-rows > span {
  24. pointer-events: none;
  25. display: block;
  26. counter-increment: linenumber;
  27. }
  28. .line-numbers-rows > span:before {
  29. content: counter(linenumber);
  30. color: #999;
  31. display: block;
  32. padding-right: 0.8em;
  33. text-align: right;
  34. }