redoc/lib/components/JsonSchema/json-schema.scss

125 lines
2.4 KiB
SCSS
Raw Normal View History

@import '../../common/styles/variables';
2015-11-22 21:04:18 +03:00
$lines-width: 1px;
$bullet-size: 7px;
$cell-spacing: 25px;
$cell-padding: 5px;
$bullet-margin: 10px;
$line-border: $lines-width solid $tree-lines-color;
$line-border-erase: $lines-width solid white;
$param-name-height: 20px;
$sub-schema-offset: ($bullet-size/2) + $bullet-margin;
2015-11-19 00:23:18 +03:00
.param-schema {
2015-11-22 21:04:18 +03:00
padding-left: $sub-schema-offset - $lines-width;
border-left: $line-border;
2015-11-19 00:23:18 +03:00
}
.param-wrap {
position: relative;
2015-11-19 00:23:18 +03:00
}
.param-schema:before {
content: "";
position: absolute;
2015-11-22 21:04:18 +03:00
left: $sub-schema-offset;
top: ($param-name-height/2) + $cell-padding;
2015-11-19 00:23:18 +03:00
bottom: 0;
2015-11-22 21:04:18 +03:00
border-left: $line-border;
2015-11-19 00:23:18 +03:00
}
.param-name {
2015-11-22 21:04:18 +03:00
font-size: 14px;
padding: $cell-padding $cell-spacing $cell-padding 0;
2015-11-19 00:23:18 +03:00
font-weight: bold;
box-sizing: border-box;
2015-11-22 21:04:18 +03:00
line-height: $param-name-height;
border-left: $line-border;
white-space: nowrap;
position: relative;
> span {
vertical-align: middle;
}
2015-11-19 00:23:18 +03:00
}
.param-info {
width: 100%;
2015-11-22 21:04:18 +03:00
padding: $cell-padding 0;
2015-11-19 00:23:18 +03:00
box-sizing: border-box;
2015-11-22 21:04:18 +03:00
border-bottom: 1px solid #ccc;
2015-11-19 00:23:18 +03:00
}
.param {
display: flex;
}
.param-required {
color: red;
font-weight: bold;
font-size: 12px;
2015-11-22 21:04:18 +03:00
line-height: $param-name-height;
vertical-align: middle;
2015-11-19 00:23:18 +03:00
}
.param-type {
text-transform: capitalize;
color: #999;
font-size: 12px;
2015-11-22 21:04:18 +03:00
line-height: $param-name-height;
vertical-align: middle;
font-weight: bold;
2015-11-19 00:23:18 +03:00
}
/* tree */
2015-11-22 21:04:18 +03:00
// Bullet
2015-11-19 00:23:18 +03:00
.param-name > span:before {
content: "";
display: inline-block;
2015-11-22 21:04:18 +03:00
width: $bullet-size;
height: $bullet-size;
background-color: $tree-lines-color;
2015-11-22 21:04:18 +03:00
margin: 0 $bullet-margin;
vertical-align: middle;
2015-11-19 00:23:18 +03:00
}
.param-name > span:after {
content: "";
position: absolute;
2015-11-22 21:04:18 +03:00
border-top: $line-border;
width: $bullet-margin;
2015-11-19 00:23:18 +03:00
left: 0;
2015-11-22 21:04:18 +03:00
top: ($param-name-height/2) + $cell-padding;
2015-11-19 00:23:18 +03:00
}
.param-wrap:first-of-type .param-name:before {
content: "";
display: block;
position: absolute;
2015-11-22 21:04:18 +03:00
left: -$lines-width;
top: 0;
border-left: $line-border-erase;
height: ($param-name-height/2) + $cell-padding;
2015-11-19 00:23:18 +03:00
}
2015-11-20 00:49:17 +03:00
.param-wrap:last-of-type > .param > .param-name:after {
2015-11-19 00:23:18 +03:00
content: "";
display: block;
position: absolute;
2015-11-22 21:04:18 +03:00
left: -$lines-width;
border-left: $line-border-erase;
top: ($param-name-height/2) + $cell-padding + $lines-width;
2015-11-19 00:23:18 +03:00
background-color: white;
bottom: 0;
}
2015-11-20 00:49:17 +03:00
.param-wrap:last-of-type > .param-schema {
border-left-color: transparent;
}
2015-11-19 00:23:18 +03:00
.param-schema .param-wrap:first-of-type .param-name:before {
display: none !important;
}