Give rendered-data sections a background and some padding (#1195)

Gives definition sections for APIs, events, etc a background and a small indent, which I find very helpful to guide the eye.
pull/1205/head
Richard van der Hoff 2 years ago committed by GitHub
parent 9093a5f16f
commit ef384f1afd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -30,6 +30,9 @@ $note: $secondary;
$note-background: $secondary-background; $note-background: $secondary-background;
$warning-background: #FFE0E0; $warning-background: #FFE0E0;
// colours for definition tables.
// the border colour matches that used for "highlight" divs
$table-border-color: rgba(black, .125);
$table-row-alternate: $secondary-lightest-background; $table-row-alternate: $secondary-lightest-background;
$table-row-default: $secondary-lighter-background; $table-row-default: $secondary-lighter-background;

@ -264,13 +264,13 @@ footer {
/* Styles for sections that are rendered from data, such as HTTP APIs and event schemas */ /* Styles for sections that are rendered from data, such as HTTP APIs and event schemas */
.rendered-data { .rendered-data {
margin: 1rem 0 3rem 0; background-color: $secondary-lightest-background;
padding: 1rem;
margin: 1rem 0;
details { details {
summary { summary {
padding: .5rem 0; padding: .5rem 0;
list-style-position: outside;
p { p {
max-width: 80%; max-width: 80%;
} }
@ -336,22 +336,30 @@ footer {
padding: 1rem; padding: 1rem;
} }
th { &.object-table, &.response-table {
background-color: $white; border: 1px $table-border-color solid;
}
caption, tr { caption {
background-color: $table-row-default; // the caption is outside the table's border box,
} // so we have to give it its own border.
border: 1px $table-border-color solid;
// ... but avoid double border between caption and table
border-bottom: 0;
}
caption, tbody tr {
background-color: $table-row-default;
}
tr:nth-child(even) { tbody tr:nth-child(even) {
background-color: $table-row-alternate; background-color: $table-row-alternate;
}
} }
&.basic-info, &.basic-info th, &.basic-info td { &.basic-info, &.basic-info th, &.basic-info td {
table-layout: fixed; table-layout: fixed;
margin: 1rem 0 .5rem 0; margin: 1rem 0 .5rem 0;
background-color: $white;
} }
&.basic-info th { &.basic-info th {

@ -0,0 +1 @@
Give rendered-data sections a background and some padding.

@ -21,7 +21,7 @@
{{ if $properties }} {{ if $properties }}
<table{{ if .anchor }} id="{{ .anchor }}"{{ end }}> <table{{ if .anchor }} id="{{ .anchor }}"{{ end }} class="object-table">
{{ with $title }} {{ with $title }}
<caption>{{ . }}</caption> <caption>{{ . }}</caption>
{{ end }} {{ end }}

@ -20,7 +20,7 @@
<h2>Responses</h2> <h2>Responses</h2>
<table class> <table class="response-table">
<thead> <thead>
<th class="col-status">Status</th> <th class="col-status">Status</th>
<th class="col-status-description">Description</th> <th class="col-status-description">Description</th>

Loading…
Cancel
Save