7777 margin-bottom : 16px ;
7878}
7979
80- .article-content {
80+ .article-container > . article-detail > . article- content {
8181 display : flex;
8282 align-items : stretch;
8383 flex-direction : column;
@@ -86,20 +86,52 @@ html {
8686 padding : 2px ;
8787}
8888
89- .article-content pre {
89+ .article-container > . article-detail > . article- content pre {
9090 padding : 0 ;
9191 border : 2px solid var (--primary );
92- border-radius : 16px ;
92+ border-radius : 0 0 16 px 16px ;
9393 width : 100% ;
9494 overflow : scroll;
9595 font-family : monospace;
96+ }
9697
98+ .article-container > .article-detail > .article-content figcaption [data-rehype-pretty-code-title ] {
99+ background-color : var (--background );
100+ color : var (--foreground );
101+ border-radius : 16px 16px 0 0 ;
102+ border : 2px solid var (--primary );
103+ padding : 4px ;
104+ }
105+ .article-container > .article-detail > .article-content code [data-line-numbers ] {
106+ counter-reset : line;
107+ }
108+
109+ .article-container > .article-detail > .article-content code [data-line-numbers ] > [data-line ]::before {
110+ display : inline-block;
111+ width : 12px ;
112+ margin-right : 1rem ;
113+ color : gray;
114+ text-align : right;
115+ content : counter (line);
116+ counter-increment : line;
117+ }
118+
119+ .article-container > .article-detail > .article-content code [data-line-numbers-max-digits = "2" ] > [data-line ]::before {
120+ width : 1.25rem ;
121+ }
122+
123+ .article-container > .article-detail > .article-content code [data-line-numbers-max-digits = "3" ] > [data-line ]::before {
124+ width : 1.75rem ;
125+ }
126+
127+ .article-container > .article-detail > .article-content code [data-line-numbers-max-digits = "4" ] > [data-line ]::before {
128+ width : 2.25rem ;
97129}
98130
99- .article-content h1 ,
100- .article-content h2 ,
101- .article-content h3 ,
102- .article-content h4 {
131+ .article-container > . article-detail > . article- content h1 ,
132+ .article-container > . article-detail > . article- content h2 ,
133+ .article-container > . article-detail > . article- content h3 ,
134+ .article-container > . article-detail > . article- content h4 {
103135 line-height : 2 ;
104136 padding-left : 10px ;
105137 margin : 10px 0 20px -5px ;
@@ -108,31 +140,31 @@ html {
108140 animation : article-h-borders 5s linear infinite;
109141}
110142
111- .article-content h1 [id ],
112- .article-content h2 [id ],
113- .article-content h3 [id ],
114- .article-content h4 [id ],
115- .article-content h5 [id ],
116- .article-content h6 [id ] {
143+ .article-container > . article-detail > . article- content h1 [id ],
144+ .article-container > . article-detail > . article- content h2 [id ],
145+ .article-container > . article-detail > . article- content h3 [id ],
146+ .article-container > . article-detail > . article- content h4 [id ],
147+ .article-container > . article-detail > . article- content h5 [id ],
148+ .article-container > . article-detail > . article- content h6 [id ] {
117149 scroll-margin-top : 64px ;
118150 /* 固定ヘッダーの高さに応じて調整 */
119151}
120152
121- .article-content h5 ,
122- .article-content h6 ,
153+ .article-container > . article-detail > . article- content h5 ,
154+ .article-container > . article-detail > . article- content h6 ,
123155.article-content p {
124156 color : var (--foreground );
125157 font-weight : 500 ;
126158}
127159
128- .article-content h1 ::before ,
129- .article-content h2 ::before ,
130- .article-content h3 ::before ,
131- .article-content h4 ::before ,
132- .article-content h1 ::after ,
133- .article-content h2 ::after ,
134- .article-content h3 ::after ,
135- .article-content h4 ::after {
160+ .article-container > . article-detail > . article- content h1 ::before ,
161+ .article-container > . article-detail > . article- content h2 ::before ,
162+ .article-container > . article-detail > . article- content h3 ::before ,
163+ .article-container > . article-detail > . article- content h4 ::before ,
164+ .article-container > . article-detail > . article- content h1 ::after ,
165+ .article-container > . article-detail > . article- content h2 ::after ,
166+ .article-container > . article-detail > . article- content h3 ::after ,
167+ .article-container > . article-detail > . article- content h4 ::after {
136168 background : linear-gradient (to right, # f00, # ff0, # 0f0, # 0ff, # 00f, # f0f, # f00 ) 0 / 200% ;
137169 content : "" ;
138170 display : block;
0 commit comments