Ponysearch/searx/static/themes/simple/src/less/toolkit.less

573 lines
11 KiB
Text
Raw Normal View History

2017-02-12 15:06:01 +01:00
// other solution : http://stackoverflow.com/questions/1577598/how-to-hide-parts-of-html-when-javascript-is-disabled/13857783#13857783
// stylelint-disable no-descending-specificity
2017-02-12 15:06:01 +01:00
html.no-js .hide_if_nojs {
display: none;
}
html.js .show_if_nojs {
display: none;
}
.center {
text-align: center;
}
.right {
float: right;
2017-02-12 15:06:01 +01:00
}
.left {
float: left;
}
.invisible {
display: none !important;
}
.list-unstyled {
list-style-type: none;
li {
margin-top: 4px;
margin-bottom: 4px;
}
2017-02-12 15:06:01 +01:00
}
.danger {
background-color: var(--color-error-background);
2017-02-12 15:06:01 +01:00
}
.warning {
background: var(--color-warning-background);
}
.success {
background: var(--color-success-background);
}
2017-02-12 15:06:01 +01:00
.badge {
display: inline-block;
color: var(--color-toolkit-badge-font);
background-color: var(--color-toolkit-badge-background);
2017-02-12 15:06:01 +01:00
text-align: center;
white-space: nowrap;
vertical-align: baseline;
min-width: 10px;
padding: 1px 5px;
border-radius: 5px;
}
// kbd
kbd {
padding: 2px 4px;
margin: 1px;
font-size: 90%;
color: var(--color-toolkit-kbd-font);
background: var(--color-toolkit-kbd-background);
}
2017-02-12 15:06:01 +01:00
// table
table {
width: 100%;
&.striped {
tr {
border-bottom: 1px solid var(--color-settings-tr-hover);
2017-02-12 15:06:01 +01:00
}
}
}
th {
padding: 0.4em;
}
td {
padding: 0 4px;
}
tr {
&:hover {
background: var(--color-settings-tr-hover);
2017-02-12 15:06:01 +01:00
}
}
// pre
.pre() {
display: block;
font-size: 0.8em;
word-break: break-all;
margin: 0.1em;
.select-all-on-focus();
}
div.selectable_url {
display: block;
border: 1px solid var(--color-result-search-url-border);
padding: 4px;
color: var(--color-result-search-url-font);
margin: 0.1em;
overflow: hidden;
height: 1.2em;
line-height: 1.2em;
pre {
.pre();
}
}
2017-02-12 15:06:01 +01:00
// dialog
.dialog() {
position: relative;
padding: 1em 1em 1em 2.7em;
margin: 0 0 1em 0;
border: 1px solid var(--color-toolkit-dialog-border);
2017-02-12 15:06:01 +01:00
text-align: left;
.rounded-corners;
2017-02-12 15:06:01 +01:00
&::before {
2017-02-12 15:06:01 +01:00
position: absolute;
top: 0.5em;
left: 0.5em;
font-family: "ion"; // stylelint-disable font-family-no-missing-generic-family-keyword
2017-02-12 15:06:01 +01:00
font-size: 1.5em;
}
.close {
float: right;
2017-02-12 15:06:01 +01:00
position: relative;
top: -3px;
color: inherit;
font-size: 1.5em;
}
ul,
ol,
p {
2017-02-12 15:06:01 +01:00
margin: 1px 0 0 0;
}
table {
width: auto;
}
tr {
vertical-align: text-top;
&:hover {
background: transparent;
}
}
td {
padding: 0 1em 0 0;
}
h4 {
margin-top: 0.3em;
margin-bottom: 0.3em;
}
2017-02-12 15:06:01 +01:00
}
.dialog-error {
.dialog();
color: var(--color-error);
background: var(--color-error-background);
border-color: var(--color-error);
2017-02-12 15:06:01 +01:00
.ion-error();
}
.dialog-warning {
.dialog();
color: var(--color-warning);
background: var(--color-warning-background);
border-color: var(--color-warning);
2017-02-12 15:06:01 +01:00
.ion-warning();
}
.dialog-modal {
.dialog();
background: var(--color-toolkit-dialog-background);
position: fixed;
top: 50%;
left: 50%;
/* bring your own prefixes */
transform: translate(-50%, -50%);
z-index: 100000;
margin: 0 50% 0 0;
box-shadow: 0 0 1em;
}
2017-02-12 15:06:01 +01:00
// btn-collapse
.btn-collapse {
cursor: pointer;
}
//
.scrollx {
overflow-x: auto;
overflow-y: hidden;
display: block;
padding: 0;
margin: 0;
border: none;
}
/* -- tabs -- */
2017-02-12 15:06:01 +01:00
.tabs .tabs > label {
font-size: 90%;
}
.tabs {
.flexbox();
2017-02-12 15:06:01 +01:00
flex-wrap: wrap;
width: 100%;
min-width: 100%;
& > * {
order: 2;
}
& > input[type=radio] {
display: none;
}
& > label {
order: 1;
padding: 0.7em;
margin: 0 0.7em;
letter-spacing: 0.5px;
2017-02-12 15:06:01 +01:00
text-transform: uppercase;
border: solid var(--color-toolkit-tabs-label-border);
border-width: 0 0 2px 0;
2017-02-12 15:06:01 +01:00
.disable-user-select();
2017-02-12 15:06:01 +01:00
cursor: pointer;
}
& > label:hover {
border-bottom: 2px solid var(--color-categories-item-border-selected);
2017-02-12 15:06:01 +01:00
}
& > section {
min-width: 100%;
padding: 0.7rem 0;
box-sizing: border-box;
border-top: 1px solid var(--color-toolkit-tabs-section-border);
2017-02-12 15:06:01 +01:00
display: none;
}
// default selection
& > label:last-of-type {
border-bottom: 2px solid var(--color-categories-item-border-selected);
background: var(--color-categories-item-selected);
color: var(--color-categories-item-selected-font);
2017-02-12 15:06:01 +01:00
font-weight: bold;
letter-spacing: -0.1px;
2017-02-12 15:06:01 +01:00
}
& > section:last-of-type {
display: block;
}
}
html body .tabs > input:checked {
~ section {
display: none;
}
2017-02-12 15:06:01 +01:00
~ label {
position: inherited;
background: inherit;
border-bottom: 2px solid transparent;
font-weight: normal;
color: inherit;
&:hover {
border-bottom: 2px solid var(--color-categories-item-border-selected);
2017-02-12 15:06:01 +01:00
}
}
2017-02-12 15:06:01 +01:00
+ label {
border-bottom: 2px solid var(--color-categories-item-border-selected);
background: var(--color-categories-item-selected);
color: var(--color-categories-item-selected-font);
2017-02-12 15:06:01 +01:00
}
2017-02-12 15:06:01 +01:00
+ label + section {
display: block;
}
}
/* -- select -- */
2017-02-12 15:06:01 +01:00
select {
height: 28px;
margin: 0 1em 0 0;
padding: 2px 8px 2px 0 !important;
color: var(--color-search-font);
2017-02-12 15:06:01 +01:00
font-size: 12px;
z-index: 2;
&:hover,
&:focus {
2017-02-12 15:06:01 +01:00
cursor: pointer;
}
}
@supports ((background-position-x: 100%) and ((appearance: none) or (-webkit-appearance: none) or (-moz-appearance: none))) {
select {
appearance: none;
-webkit-appearance: none;
-moz-appearance: none;
border: none;
border-bottom: 1px solid var(--color-toolkit-select-border);
2017-02-12 15:06:01 +01:00
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI1MTJweCIgaGVpZ2h0PSI1MTJweCIgdmlld0JveD0iMCAwIDUxMiA1MTIiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUxMiA1MTIiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxnPjxwb2x5Z29uIHBvaW50cz0iMTI4LDE5MiAyNTYsMzIwIDM4NCwxOTIiLz48L2c+PC9zdmc+Cg==) no-repeat;
background-position-x: 105%;
background-size: 2em;
background-origin: content-box;
outline: medium none;
&:hover,
&:focus {
border-bottom: 1px solid var(--color-search-border);
2017-02-12 15:06:01 +01:00
}
}
}
/* -- checkbox-onoff -- */
2017-02-12 15:06:01 +01:00
@supports (border-radius: 50px) {
.checkbox-onoff {
display: inline-block;
width: 40px;
height: 10px;
background: var(--color-toolkit-checkbox-onoff-background);
margin: 8px 1rem;
2017-02-12 15:06:01 +01:00
position: relative;
border-radius: 50px;
2017-02-12 15:06:01 +01:00
label {
display: block;
width: 20px;
height: 20px;
position: absolute;
top: -5px;
cursor: pointer;
border-radius: 50px;
box-shadow: 0 3px 5px 0 var(--color-toolkit-checkbox-onoff-label-shadow);
2017-02-12 15:06:01 +01:00
transition: all 0.4s ease;
left: 27px;
background-color: var(--color-toolkit-checkbox-onoff-label-background);
2017-02-12 15:06:01 +01:00
}
2017-02-12 15:06:01 +01:00
input[type=checkbox] {
visibility: hidden;
2017-02-12 15:06:01 +01:00
&:checked + label {
left: -5px;
background: var(--color-toolkit-checkbox-onoff-checked-background);
2017-02-12 15:06:01 +01:00
}
}
}
}
/* -- checkbox -- */
2017-02-12 15:06:01 +01:00
@supports (transform: rotate(-45deg)) {
.checkbox {
width: 20px;
position: relative;
margin: 20px auto;
2017-02-12 15:06:01 +01:00
label {
width: 20px;
height: 20px;
cursor: pointer;
position: absolute;
top: 0;
left: 0;
background: var(--color-toolkit-checkbox-label-background);
.rounded-corners;
&::after {
2017-02-12 15:06:01 +01:00
content: '';
width: 9px;
height: 5px;
position: absolute;
top: 4px;
left: 4px;
border: 3px solid var(--color-toolkit-checkbox-label-border);
2017-02-12 15:06:01 +01:00
border-top: none;
border-right: none;
background: transparent;
opacity: 0;
transform: rotate(-45deg);
}
}
input[type=checkbox] {
visibility: hidden;
&:checked + label::after {
border-color: var(--color-toolkit-checkbox-input-border);
2017-02-12 15:06:01 +01:00
opacity: 1;
}
}
// disabled : can''t be focused, show only the check mark
input[disabled] + label {
2017-02-12 15:06:01 +01:00
background-color: transparent !important;
box-shadow: none !important;
cursor: inherit;
2017-02-12 15:06:01 +01:00
}
// if not checked and possible to checked then display a "light" check mark on hover
input:not(:checked):not([readonly]):not([disabled]) + label:hover::after {
opacity: 0.5;
}
}
}
@media screen and (max-width: 50em) {
.tabs > label {
width: 100%;
}
}
/* -- loader -- */
.loader,
.loader::after {
border-radius: 50%;
width: 2em;
height: 2em;
}
.loader {
margin: 1em auto;
font-size: 10px;
position: relative;
text-indent: -9999em;
border-top: 0.5em solid var(--color-toolkit-loader-border);
border-right: 0.5em solid var(--color-toolkit-loader-border);
border-bottom: 0.5em solid var(--color-toolkit-loader-border);
border-left: 0.5em solid var(--color-toolkit-loader-borderleft);
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
-webkit-animation: load8 1.2s infinite linear;
animation: load8 1.2s infinite linear;
}
@-webkit-keyframes load8 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes load8 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
/* -- engine-tooltip -- */
.engine-tooltip {
display: none;
position: absolute;
padding: 0.5rem 1rem;
margin: 0 0 0 2rem;
border: 1px solid var(--color-toolkit-engine-tooltip-border);
box-shadow: 0 0 5px var(--color-toolkit-engine-tooltip-shadow);
background: var(--color-toolkit-engine-tooltip-background);
font-size: 14px;
font-weight: normal;
z-index: 1000000;
text-align: left;
.rounded-corners;
}
th:hover .engine-tooltip,
td:hover .engine-tooltip,
.engine-tooltip:hover {
display: inline-block;
}
/* -- stacked bar chart -- */
.stacked-bar-chart {
margin: 0;
padding: 0 0.125rem 0 4rem;
width: 100%;
width: -moz-available;
width: -webkit-fill-available;
width: fill;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
display: inline-flex;
}
.stacked-bar-chart-value {
width: 3rem;
display: inline-block;
position: absolute;
2021-04-21 18:49:13 +02:00
padding: 0 0.5rem;
text-align: right;
}
.stacked-bar-chart-base {
display: flex;
flex-shrink: 0;
flex-grow: 0;
flex-basis: unset;
}
.stacked-bar-chart-median {
.stacked-bar-chart-base();
background: @stacked-bar-chart;
border: 1px solid fade(@stacked-bar-chart, 90%);
padding: 0.3rem 0;
}
.stacked-bar-chart-rate80 {
.stacked-bar-chart-base();
background: transparent;
border: 1px solid fade(@stacked-bar-chart, 30%);
padding: 0.3rem 0;
}
.stacked-bar-chart-rate95 {
.stacked-bar-chart-base();
background: transparent;
border-bottom: 1px dotted fade(@stacked-bar-chart, 50%);
padding: 0;
}
.stacked-bar-chart-rate100 {
.stacked-bar-chart-base();
background: transparent;
border-left: 1px solid fade(@stacked-bar-chart, 90%);
padding: 0.4rem 0;
width: 1px;
}