@callstack/rspress-theme
Version:
Callstack theme for Rspress docs
131 lines (119 loc) • 3.44 kB
CSS
/* container */
.rp-callout {
background: none ;
border: 1px dashed transparent ;
border-left: 2px solid ;
border-radius: 0px ;
padding: 8px 16px ;
margin: 1rem 0 ;
font-family: var(--rp-font-family) ;
display: flex ;
align-items: flex-start ;
flex-direction: column ;
}
/* container title */
.rp-callout__title {
display: flex ;
flex-direction: row ;
align-items: center ;
font-weight: 500 ;
margin-bottom: 0 ;
line-height: 1.5 ;
color: var(--rp-c-text-1) ;
}
/* container icon */
.rp-callout .rp-callout__title::before {
display: inline-block;
position: relative;
top: 0;
left: 0;
width: 24px;
height: 24px;
margin-right: 16px;
}
/* container content */
.rp-callout__content > * {
font-size: 16px ;
margin-left: 40px ;
}
/* container content links */
.rp-callout .rp-callout__content a {
font-weight: 400 ;
}
/* directive content width to avoid overflowing the container */
.rp-callout__content {
width: 100%;
}
/* container custom border left colors */
.rp-callout--info {
border-left-color: var(--rp-container-info-border) ;
}
.rp-callout--tip {
border-left-color: var(--rp-container-tip-border) ;
}
.rp-callout--warning {
border-left-color: var(--rp-container-warning-border) ;
}
.rp-callout--danger {
border-left-color: var(--rp-container-danger-border) ;
}
.rp-callout--details {
border-left-color: var(--rp-container-details-border) ;
}
.rp-callout--note {
border-left-color: var(--rp-container-note-border) ;
}
/* container custom icon */
.rp-callout--tip .rp-callout__title::before {
content: "";
background: url("../assets/check-double.svg") no-repeat center center /
contain;
background-color: transparent ;
}
.rp-callout--info .rp-callout__title::before {
content: "";
background: url("../assets/info-box.svg") no-repeat center center / contain;
background-color: transparent ;
}
.rp-callout--warning .rp-callout__title::before {
content: "";
background: url("../assets/warning-box.svg") no-repeat center center / contain;
background-color: transparent ;
}
.rp-callout--danger .rp-callout__title::before {
content: "";
background: url("../assets/alert.svg") no-repeat center center / contain;
background-color: transparent ;
}
.rp-callout--details .rp-callout__title::before {
content: "";
background: url("../assets/details.svg") no-repeat center center / contain;
background-color: transparent ;
}
.rp-callout--note .rp-callout__title::before {
content: "";
background: url("../assets/notes.svg") no-repeat center center / contain;
background-color: transparent ;
}
details.details {
position: relative;
}
summary.rp-callout__title {
width: 100%;
}
details[open] > summary.rp-callout__title::after {
content: "";
position: absolute;
left: 95%;
width: 24px;
height: 24px;
background: url("../assets/arrow-right.svg") no-repeat center center / contain;
}
details:not([open]) > summary.rp-callout__title::after {
content: "";
position: absolute;
left: 95%;
width: 24px;
height: 24px;
background: url("../assets/arrow-down.svg") no-repeat center center / contain;
}