Guest User

Untitled

a guest
Jun 22nd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. /** initialize css counter */
  2. #write {
  3. counter-reset: h1
  4. }
  5.  
  6. h1 {
  7. counter-reset: h2
  8. }
  9.  
  10. h2 {
  11. counter-reset: h3
  12. }
  13.  
  14. h3 {
  15. counter-reset: h4
  16. }
  17.  
  18. h4 {
  19. counter-reset: h5
  20. }
  21.  
  22. h5 {
  23. counter-reset: h6
  24. }
  25.  
  26. /** put counter result into headings */
  27. #write h2:before {
  28. counter-increment: h1;
  29. content: counter(h1) ". "
  30. }
  31.  
  32. #write h3:before {
  33. counter-increment: h2;
  34. content: counter(h1) "." counter(h2) ". "
  35. }
  36.  
  37. #write h4:before,
  38. h3.md-focus.md-heading:before /** override the default style for focused headings */ {
  39. counter-increment: h3;
  40. content: counter(h1) "." counter(h2) "." counter(h3) ". "
  41. }
  42.  
  43. #write h5:before,
  44. h4.md-focus.md-heading:before {
  45. counter-increment: h4;
  46. content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) ". "
  47. }
  48.  
  49. #write h6:before,
  50. h5.md-focus.md-heading:before {
  51. counter-increment: h5;
  52. content: counter(h1) "." counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) ". "
  53. }
  54.  
  55.  
  56. /** override the default style for focused headings */
  57. #write>h3.md-focus:before,
  58. #write>h4.md-focus:before,
  59. #write>h5.md-focus:before,
  60. #write>h6.md-focus:before,
  61. h3.md-focus:before,
  62. h4.md-focus:before,
  63. h5.md-focus:before,
  64. h6.md-focus:before {
  65. color: inherit;
  66. border: inherit;
  67. border-radius: inherit;
  68. position: inherit;
  69. left:initial;
  70. float: none;
  71. top:initial;
  72. font-size: inherit;
  73. padding-left: inherit;
  74. padding-right: inherit;
  75. vertical-align: inherit;
  76. font-weight: inherit;
  77. line-height: inherit;
  78. }
Add Comment
Please, Sign In to add comment