dumi
Version:
📖 Documentation Generator of React Component
182 lines (150 loc) • 3.54 kB
text/less
@import (reference) '../../styles/variables.less';
.@{prefix}-previewer {
margin: 24px 0 32px;
border: 1px solid @c-border-light;
border-radius: 4px;
background-color: inherit;
@{dark-selector} & {
border-color: @c-border-less-dark;
}
[data-dumi-demo-grid] & {
margin: 0 0 16px;
&:first-child {
margin-top: 24px;
}
&:last-child {
margin-bottom: 32px;
}
}
&-demo {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
padding: 40px 24px;
> iframe {
display: block;
width: 100%;
height: 300px;
border: 0;
}
// demo render controls
&[data-iframe] {
position: relative;
padding: 0;
overflow: hidden;
&::before {
content: '';
display: block;
height: 24px;
background-color: @c-border-light;
@{dark-selector} & {
background-color: @c-border-less-dark;
}
}
&::after {
@btn-gap: 8px;
@btn-width: 12px;
content: '';
position: absolute;
top: 5px;
left: @btn-gap;
display: inline-block;
width: @btn-width;
height: @btn-width;
border-radius: 50%;
background-color: #fd6458;
box-shadow: (@btn-width + @btn-gap) 0 0 #ffbf2b,
(@btn-width + @btn-gap) * 2 0 0 #24cc3d;
}
}
&[data-transform] {
transform: translate(0, 0);
}
&[data-compact] {
padding: 0;
}
}
&-meta {
border-top: 1px solid @c-border-light;
@{dark-selector} & {
border-top-color: @c-border-less-dark;
}
}
&-desc {
position: relative;
> .markdown {
padding: 14px 24px;
border-bottom: 1px dashed @c-border-light;
@{dark-selector} & {
border-bottom-color: @c-border-less-dark;
}
}
> h5 {
position: absolute;
top: -7px;
left: 20px;
margin: 0;
padding: 0 4px;
display: inline-block;
font-size: 14px;
line-height: 1;
font-weight: bold;
background: linear-gradient(
to top,
rgba(255, 255, 255, 100%),
rgba(255, 255, 255, 100%) 50%,
rgba(255, 255, 255, 0%)
)
100%;
@{dark-selector} & {
background: linear-gradient(
to top,
rgba(0, 0, 0, 95%),
rgba(0, 0, 0, 95%) 50%,
rgba(0, 0, 0, 0%)
)
100%;
}
> a {
color: @c-text;
@{dark-selector} & {
color: @c-text-dark;
}
&:not(:hover) {
text-decoration: none;
}
> strong {
float: inline-start;
padding-inline-end: 8px;
color: @c-warning;
font-size: 12px;
line-height: 15px;
@{dark-selector} & {
color: @c-warning-dark;
}
}
}
}
}
// active
&[data-active] {
box-shadow: 0 0 0 4px fade(@c-primary, 10%);
border-color: lighten(@c-primary, 20%);
@{dark-selector} & {
box-shadow: 0 0 0 4px fade(@c-primary-dark, 10%);
border-color: darken(@c-primary-dark, 20%);
}
}
// debug mode
&[data-debug] {
border-color: lighten(@c-warning, 20%);
@{dark-selector} & {
border-color: darken(@c-warning-dark, 20%);
}
&[data-active] {
box-shadow: 0 0 0 4px fade(@c-warning, 10%);
@{dark-selector} & {
box-shadow: 0 0 0 4px fade(@c-warning-dark, 10%);
}
}
}
}