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

192 lines
3.4 KiB
SCSS
Raw Normal View History

@import '../../common/styles/variables';
$lines-width: 1px;
$bullet-size: 7px;
$cell-spacing: 25px;
$cell-padding: 10px;
$bullet-margin: 10px;
$line-border: $lines-width solid $tree-lines-color;
$line-border-erase: ($lines-width + 1px) solid white;
$param-name-height: 20px;
$sub-schema-offset: ($bullet-size/2) + $bullet-margin;
.param-schema {
padding-left: $sub-schema-offset - $lines-width;
border-left: $line-border;
}
.param-wrap {
position: relative;
}
.param-schema:before {
content: "";
position: absolute;
left: $sub-schema-offset;
top: ($param-name-height/2) + $cell-padding;
bottom: 0;
border-left: $line-border;
}
.param-name {
flex-grow: 0;
-ms-flex-grow: 0;
display: inline-block;
font-size: 14px;
padding: $cell-padding 0 $cell-padding 0;
font-weight: bold;
box-sizing: border-box;
line-height: $param-name-height;
border-left: $line-border;
white-space: nowrap;
position: relative;
}
.param-name-content {
padding-right: $cell-spacing;
display: inline-block;
}
.param-info {
//width: 100%;
flex-grow: 1;
-ms-flex-grow: 1;
padding: $cell-padding 0;
box-sizing: border-box;
border-bottom: 1px solid #ccc;
display: inline-block;
}
.param {
display: flex;
display: -ms-flexbox;
}
.param-required {
color: red;
font-weight: bold;
font-size: 12px;
line-height: $param-name-height;
vertical-align: middle;
}
.param-type {
color: #999;
font-size: 12px;
line-height: $param-name-height;
vertical-align: middle;
font-weight: bold;
}
.param-type.array:before {
content: "Array of ";
color: #999;
}
2016-02-06 18:00:31 +03:00
.param-type.string, .enum-value.string {
color: rgba(0, 80, 0, 0.7);
}
2016-02-06 18:00:31 +03:00
.param-type.integer, .param-type.number, .enum-value.number {
color: rgba(74, 139, 179, 0.8);
}
.param-type.object {
color: rgba(0, 50, 159, 0.7);
}
2016-02-06 18:00:31 +03:00
.param-type.boolean, .enum-value.boolean {
color: firebrick;
}
.param-type.with-hint {
2016-03-13 02:56:33 +03:00
display: inline-block;
margin-bottom: 0.4em;
border-bottom: 1px dotted rgba(38,50,56,0.4);
padding: 0;
cursor: help;
}
.param-type-trivial {
margin: 10px 10px 0;
display: inline-block;
}
/* tree */
// Bullet
.param-name > span:before {
content: "";
display: inline-block;
width: $bullet-size;
height: $bullet-size;
background-color: $tree-lines-color;
margin: 0 $bullet-margin;
vertical-align: middle;
}
.param-name > span:after {
content: "";
position: absolute;
border-top: $line-border;
width: $bullet-margin;
left: 0;
top: ($param-name-height/2) + $cell-padding;
}
.param-wrap:first-of-type > .param > .param-name:before {
content: "";
display: block;
position: absolute;
left: -$lines-width;
top: 0;
border-left: $line-border-erase;
height: ($param-name-height/2) + $cell-padding;
}
.param-wrap:last-of-type > .param > .param-name {
position: static;
&:after {
content: "";
display: block;
position: absolute;
left: -$lines-width;
border-left: $line-border-erase;
top: ($param-name-height/2) + $cell-padding + $lines-width;
background-color: white;
bottom: 0;
}
}
.param-wrap:last-of-type > .param-schema {
border-left-color: transparent;
}
.param-schema .param-wrap:first-of-type .param-name:before {
display: none !important;
}
2016-02-06 18:00:31 +03:00
.param-enum {
color: #666;
&:before {
content: "Values: {"
}
&:after {
content: "}"
}
> .enum-value {
&:after {
content: ", ";
}
&:last-of-type:after {
content: none;
}
}
}