@@ -5,25 +5,26 @@ import * as React from "react"
55import { CategoryArticle } from "."
66import SubCategoryArticles from "./sub-category"
77
8- export const CategoryLine = styled ( `div` ) < { size : 'main' | 'sub' | 'nested' , top : number , left : number , plusHeight : number } > (
9- ( { size, top, left, plusHeight : minusHeight } ) => ( {
10- content : '""' ,
11- position : 'absolute' ,
12- top : `${ top } px` ,
13- left : `${ left } px` ,
14- height : `calc(100% + ${ minusHeight } px)` ,
15- width : '2px' ,
16- backgroundColor : 'var(--text-link)' ,
17- '@media only screen and (max-width: 700px)' : {
18- top : `${ top + ( size === 'nested' ? 2 : ( size === 'sub' ? 5 : 2 ) ) } px` ,
19- height : `calc(100% + ${ minusHeight - ( size === 'nested' ? 2 : ( size === 'sub' ? 36 : 6 ) ) } px)` ,
20- } ,
21- '@media only screen and (max-width: 600px)' : {
22- top : `${ top + ( size === 'nested' ? 4 : ( size === 'sub' ? 7 : 3 ) ) } px` ,
23- height : `calc(100% + ${ minusHeight - ( size === 'nested' ? 4 : ( size === 'sub' ? 77 : 6 ) ) } px)` ,
24- } ,
25- } )
26- )
8+ export const CategoryLine = styled ( `div` ) ( {
9+ content : '""' ,
10+ position : 'absolute' ,
11+ width : '2px' ,
12+ backgroundColor : 'var(--text-link)' ,
13+ } )
14+
15+ const CategoryMainLine = styled ( CategoryLine ) ( {
16+ left : `14px` ,
17+ top : `-0.2rem` ,
18+ height : `calc(100% + 1.5rem + 0.3rem)` ,
19+ '@media only screen and (max-width: 700px)' : {
20+ top : `0px` ,
21+ height : `calc(100% + 1.5rem)` ,
22+ } ,
23+ '@media only screen and (max-width: 600px)' : {
24+ top : `0px` ,
25+ height : `calc(100% + 1.5rem)` ,
26+ } ,
27+ } )
2728
2829export const sliceStringWithMax = ( str : string , max : number ) =>
2930 ( str . length >= max )
@@ -39,7 +40,7 @@ const MainCategoryArticles: React.FunctionComponent<{ maxTitleLength: number, ca
3940 < MainCategoryBox key = { mainCategory } >
4041 < MainCategoryTitle category = { mainCategory } articleCount = { each . count } />
4142 < ul css = { styles . articles } key = { mainCategory } >
42- { hasSubCategory && < CategoryLine size = "main" top = { - 4 } left = { 14 } plusHeight = { 30 } /> }
43+ { hasSubCategory && < CategoryMainLine /> }
4344 { each . articles . map ( article => (
4445 < li css = { styles . article } key = { article . title } >
4546 < Link css = { styles . articleTitle } to = { article . link } >
@@ -133,7 +134,7 @@ export const styles = {
133134 ` ,
134135 articles : css `
135136 position : relative;
136- top : -12 px ;
137+ top : -0.8 rem ;
137138 margin-bottom : -6px ;
138139 ` ,
139140 nestedArticles : css `
0 commit comments