Advertisement
tsapaste

Variables in CSS Selectors

Dec 19th, 2020
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. The selectors for links on Hacker News are as below,where 'xxxxxxx' is a random 7 digit number.
  2. ---
  3.  
  4. #\32 xxxxxxx .storylink {
  5. }
  6.  
  7. ---
  8. How would I create a variable to stand in for that 7 digit number?
  9. here's my current userstyle
  10. ---
  11.  
  12. /* ==UserStyle==
  13. @name Modern Hacker News Dark
  14. @namespace github.com/losuler/hacker-news-userstyle
  15. @homepageURL https://github.com/losuler/hacker-news-userstyle
  16. @description A modern dark Hacker News userstyle
  17. @updateURL https://github.com/losuler/hacker-news-userstyle/blob/master/modern-hacker-news-dark.user.css
  18. @version 1.0.0
  19. @preprocessor stylus
  20. ==/UserStyle== */
  21. @-moz-document url-prefix("https://news.ycombinator.com") {
  22. /* reset */
  23. :root{
  24. --bg:#000000;
  25. --text:#CCCCCC;
  26. --fsize:18px;
  27. --container-bg:#000044;
  28. --container-text:#ffffff;
  29. }
  30.  
  31. body{
  32. background-color: var(--bg);
  33. }
  34. #hnmain,#hnmain table,#hnmain > tbody > tr > td,a link,.storylink{
  35. background-color: var(--container-bg);
  36. color:var(--container-text);
  37. font-size:var(--fsize);
  38. }
  39. }
  40.  
  41. ---
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement