koffi
Version:
Fast and simple C FFI (foreign function interface) for Node.js
429 lines (396 loc) • 9.88 kB
CSS
/* Copyright (C) 2024 Niels Martignène <niels.martignene@protonmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the “Software”), to deal in
the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE. */
html {
--top_color: #ccc;
--anchor_color: #383838;
--button_color: #888;
--focus_color: #ececec;
--top_height: 90px;
--top_padding: 6px;
--small_height: 80px;
--top_background: white;
--footer_background: #f6f6f9;
height: 100%;
scroll-padding-top: calc(var(--top_height) + 10px);
}
body {
min-height: 100%;
margin: 0;
padding: 0;
font-family: 'Open Sans', sans-serif;
font-size: 17px;
line-height: 1.5;
background: white;
color: #383838;
display: flex;
flex-direction: column;
}
canvas:focus {
border: none;
outline: none;
}
a {
color: var(--color, var(--anchor_color));
cursor: pointer;
text-decoration: none;
}
a:hover { text-decoration: underline; }
a:has(> img) { text-decoration: none ; }
#top {
position: sticky;
top: 0;
background: var(--top_background);
z-index: 9;
border-bottom: 2px solid var(--top_background);
transition: border-bottom-color 0.4s ease;
}
#top.border { border-bottom-color: #383838; }
#top menu {
position: sticky;
top: 0;
box-sizing: border-box;
max-width: 1200px;
height: var(--top_height);
box-sizing: border-box;
margin: 0 auto;
padding: var(--top_padding);
overflow: visible;
z-index: 1;
display: flex;
align-items: center;
gap: 10px;
}
#top li {
position: relative;
list-style-type: none;
padding-left: 8px;
border-left: 2px solid rgba(0, 0, 0, 0);
}
#top li a {
color: #383838;
text-decoration: none;
}
#top li > div a.category {
cursor: default;
pointer-events: none;
}
#top li > a {
display: block;
border-bottom: 1px solid #383838;
text-transform: uppercase;
text-wrap: nowrap;
}
#top li > a:hover, #top li.active > a {
margin-bottom: -1px;
border-bottom: 2px solid var(--top_color);
color: var(--top_color);
}
#top li > a.active {
font-weight: bold;
border-bottom-color: var(--top_color);
color: var(--top_color);
}
#top li > div { display: none; }
.nojs #top li:has(> div):hover, #top li:has(> div).active { border-left-color: var(--top_color); }
.nojs #top li:has(> div):hover > a, #top li:has(> div).active > a {
margin-bottom: 1px;
border-bottom: none;
}
.nojs #top li:hover > div, #top li.active > div {
position: absolute;
margin-top: 0px;
margin-left: -10px;
width: 220px;
padding: 12px 1em 10px 1em;
display: flex;
flex-direction: column;
background: var(--top_background);
border-left: 2px solid var(--top_color);
border-bottom: 2px solid var(--top_color);
}
#top li > div > a { margin-top: 3px; }
#top li > div > a.active { font-weight: bold; }
#top li > div > a:hover { text-decoration: underline; }
#logo {
height: 70%;
object-fit: contain;
margin-right: 2em;
}
#logo > img {
width: 100%;
height: 100%;
object-fit: contain;
}
#side menu {
margin: 0;
padding: 8px;
width: 224px;
box-sizing: border-box;
position: fixed;
left: calc(50% + 360px);
top: calc(var(--top_height) + 34px);
background: #fdfdfd;
border: 2px solid #383838;
}
#side li { list-style-type: none; }
#side a {
display: block;
padding: 1px;
color: #383838;
text-decoration: none;
}
#side a:hover { text-decoration: underline; }
#side a.active { font-weight: bold; }
#side a.lv1 { padding-left: 12px; }
#side a.lv2 { padding-left: 27px; }
#side a.lv3 { padding-left: 42px; }
#side a.lv4 { padding-left: 57px; }
#side a.lv5 { padding-left: 72px; }
#side a.lv6 { padding-left: 87px; }
:is(#deploy, .deploy) { display: none; }
main {
flex: 1;
width: 100%;
max-width: 1200px;
box-sizing: border-box;
margin: 20px auto 0 auto;
padding: 0 16px 16px 16px;
}
#side ~ main { padding-right: 290px; }
footer {
padding: 0.5em;
background: var(--footer_background);
display: flex;
gap: 1.5em;
align-items: center;
justify-content: center;
}
footer > img { filter: saturate(0%) brightness(0); }
p { margin: 1em 0 0 0; }
p:first-child, h1 + p, h2 + p, h3 + p { margin-top: 0; }
main img { max-width: 100%; }
h1 {
margin: 0 0 0.5em 0;
font-size: 1.6em;
text-transform: uppercase;
font-weight: normal;
color: #383838;
font-weight: bold;
}
h2 {
margin: 0 0 1em 0;
display: table;
padding: 2px 14px 2px 30px;
background: #191f22;
font-size: 1.2em;
font-weight: normal;
text-transform: uppercase;
color: white;
}
h3 {
margin: 0 0 0.8em 0;
display: table;
padding: 2px 14px 2px 40px;
background: #ddd;
font-size: 1.1em;
font-weight: normal;
font-style: italic;
text-transform: uppercase;
color: #383838;
}
* + h1, * + h2, * + h3 { margin-top: 1.2em; }
table {
margin: 0 auto;
border-collapse: collapse;
empty-cells: show;
}
* + table { margin-top: 1em; }
tr {
border-bottom: 1px solid #ededf0;
vertical-align: middle;
}
th, td {
height: 1.5em;
padding: 0.5em;
vertical-align: middle;
}
th {
background: #f8f8f8;
font-size: 0.9em;
font-variant: small-caps;
text-align: left;
user-select: none;
-webkit-user-select: none;
}
td {
background: white;
border: 1px solid #ebebeb;
}
thead > tr { border: 1px solid #ededf0; }
thead th { text-align: center; }
tbody th {
text-align: left;
font-weight: normal;
font-style: italic;
}
th.center, td.center { text-align: center; }
th.right, td.right { text-align: right; }
table :is(td, th, col).check { width: 2em; }
table :is(td, th).center { text-align: center; }
table :is(td, th).right { text-align: right; }
table :is(tr, td, th, col).missing {
font-style: italic;
color: var(--color, gray);
}
table :is(td, th).picture { padding: 6px 0 0 6px; }
table :is(td, th).picture > img {
width: 24px;
height: 24px;
}
table + div.legend {
margin-top: 6px;
text-align: center;
font-size: 0.8em;
}
hr {
margin: 4px auto;
width: 90%;
border: none;
border-bottom: 1px solid #ededf0;
}
button {
padding: 0.35em 1em 0.45em 1em;
background: var(--button_color);
border: none;
border-radius: 10px;
color: white;
cursor: pointer;
white-space: nowrap;
}
button::-moz-focus-inner { border: 0; }
button:not(:disabled):not(.active):hover {
background: color-mix(in srgb, var(--button_color) 90%, black);
color: white;
}
button:disabled {
filter: saturate(10%) brightness(80%);
cursor: not-allowed;
pointer-events: none;
}
button:disabled > * { opacity: 0.3; }
button.active { background: color-mix(in srgb, var(--button_color) 50%, black); }
button > img {
width: 16px;
height: 16px;
transform: translateY(2px);
}
button > img:only-child {
width: 32px;
height: 32px;
transform: translateY(4px);
}
.actions {
display: flex;
margin-top: 1em;
gap: 20px;
justify-content: center;
align-items: start;
flex-wrap: wrap;
}
.actions + * { margin-top: 1em; }
.actions > :is(a, button) {
display: block;
width: 30%;
min-width: 10em;
background: var(--button_color);
color: white;
padding: 0.35em 2em 0.45em 2em;
text-decoration: none;
text-align: center;
}
.actions > :is(a, button):hover {
background: color-mix(in srgb, var(--button_color) 90%, black);
color: white;
}
.actions > :is(a, button).disabled {
pointer-events: none;
filter: saturate(10%) brightness(50%);
}
span.warning { color: var(--color, red); }
span.warning:before {
content: "⚠\FE0E";
margin-right: 2px;
}
code:not(.hljs) {
padding: 2px 6px;
font-family: monospace;
font-size: 14px;
background: #eee;
}
pre > code:not(.hljs) {
padding: 0;
font-size: inherit;
background: transparent;
}
pre {
position: relative;
margin: 1em 20px;
padding: 0;
border: 1px solid #ebebeb;
background: #ffffff;
overflow: auto;
font-size: 12px;
z-index: 0;
}
.nojs pre { padding: 6px; }
.alert {
margin: 1.8em 1em 1.4em 1em;
padding: 0.8em 1em;
background: #fcfcfc;
border-left: 3px solid var(--color);
}
.alert:first-child { margin-top: 0; }
.alert > .title {
font-weight: bold;
color: var(--color);
}
.alert > .title::after { content: var(--text); }
.alert.note {
--color: #316dca;
--text: 'Note';
}
.alert.tip {
--color: #347d39;
--text: 'Tip';
}
.alert.important {
--color: #8256d0;
--text: '⚠\FE0E Important';
}
.alert.warning {
--color: #966600;
--text: '⚠\FE0E Warning';
}
.alert.caution {
--color: #c93c37;
--text: '⚠\FE0E Caution';
}
.footnotes {
margin: 2em 1em;
font-style: italic;
}