style.less 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850
  1. /*
  2. * SearXNG, A privacy-respecting, hackable metasearch engine
  3. *
  4. * To convert "style.less" to "style.css" run: $make styles
  5. */
  6. // stylelint-disable no-descending-specificity
  7. @import "../../__common__/less/new_issue.less";
  8. @import "../../__common__/less/stats.less";
  9. @import "../../__common__/less/result_templates.less";
  10. @import (inline) "../../node_modules/normalize.css/normalize.css";
  11. @import "definitions.less";
  12. @import "mixins.less";
  13. @import "code.less";
  14. @import "toolkit.less";
  15. @import "autocomplete.less";
  16. @import "detail.less";
  17. @import "animations.less";
  18. @import "embedded.less";
  19. // for index.html template
  20. @import "index.less";
  21. // for preferences.html template
  22. @import "preferences.less";
  23. // Search-Field
  24. @import "search.less";
  25. // ion-icon
  26. .ion-icon {
  27. display: inline-block;
  28. vertical-align: bottom;
  29. line-height: 1;
  30. text-decoration: inherit;
  31. .ltr-transform();
  32. }
  33. .ion-icon-small {
  34. width: 1rem;
  35. height: 1rem;
  36. .ion-icon;
  37. }
  38. .ion-icon-big {
  39. width: 1.5rem;
  40. height: 1.5rem;
  41. .ion-icon;
  42. }
  43. // Main LESS-Code
  44. html {
  45. font-family: sans-serif;
  46. font-size: 0.9em;
  47. .text-size-adjust;
  48. color: var(--color-base-font);
  49. background-color: var(--color-base-background);
  50. padding: 0;
  51. margin: 0;
  52. }
  53. body,
  54. main {
  55. padding: 0;
  56. margin: 0;
  57. }
  58. body {
  59. display: flex;
  60. flex-direction: column;
  61. height: 100vh;
  62. margin: 0;
  63. }
  64. main {
  65. width: 100%;
  66. margin-bottom: 2rem;
  67. flex: 1;
  68. }
  69. .page_with_header {
  70. margin: 2em auto;
  71. width: 85em;
  72. }
  73. footer {
  74. clear: both;
  75. min-height: 4rem;
  76. padding: 1rem 0;
  77. width: 100%;
  78. text-align: center;
  79. background-color: var(--color-footer-background);
  80. border-top: 1px solid var(--color-footer-border);
  81. overflow: hidden;
  82. p {
  83. font-size: 0.9em;
  84. }
  85. }
  86. .page_with_header .logo {
  87. height: 40px;
  88. }
  89. input[type="submit"],
  90. #results button[type="submit"] {
  91. padding: 0.7rem;
  92. display: inline-block;
  93. background: var(--color-btn-background);
  94. color: var(--color-btn-font);
  95. .rounded-corners;
  96. border: 0;
  97. cursor: pointer;
  98. }
  99. a {
  100. text-decoration: none;
  101. color: var(--color-url-font);
  102. &:visited {
  103. color: var(--color-url-visited-font);
  104. .highlight {
  105. color: var(--color-url-visited-font);
  106. }
  107. }
  108. }
  109. article[data-vim-selected] {
  110. background: var(--color-result-vim-selected);
  111. .ltr-border-left(0.2rem solid var(--color-result-vim-arrow));
  112. .ltr-rounded-right-corners(10px);
  113. }
  114. article.result-images[data-vim-selected] {
  115. background: var(--color-result-vim-arrow);
  116. border: none;
  117. .rounded-corners;
  118. .image_thumbnail {
  119. filter: opacity(60%);
  120. }
  121. }
  122. article[data-vim-selected].category-videos,
  123. article[data-vim-selected].category-news,
  124. article[data-vim-selected].category-map,
  125. article[data-vim-selected].category-music,
  126. article[data-vim-selected].category-files,
  127. article[data-vim-selected].category-social {
  128. border: 1px solid var(--color-result-vim-arrow);
  129. .rounded-corners;
  130. }
  131. .result {
  132. margin: @results-margin 0;
  133. padding: @result-padding;
  134. .ltr-border-left(0.2rem solid transparent);
  135. h3 {
  136. font-size: 1.2rem;
  137. word-wrap: break-word;
  138. margin: 0.4rem 0 0.4rem 0;
  139. padding: 0;
  140. a {
  141. color: var(--color-result-link-font);
  142. font-weight: normal;
  143. font-size: 1.1em;
  144. &:visited {
  145. color: var(--color-result-link-visited-font);
  146. }
  147. &:focus,
  148. &:hover {
  149. text-decoration: underline;
  150. border: none;
  151. outline: none;
  152. }
  153. }
  154. }
  155. .cache_link,
  156. .proxyfied_link {
  157. font-size: 0.9em !important;
  158. }
  159. .content,
  160. .stat,
  161. .altlink {
  162. font-size: 0.9em;
  163. margin: 0;
  164. padding: 0;
  165. max-width: 54em;
  166. word-wrap: break-word;
  167. line-height: 1.24;
  168. .highlight {
  169. color: var(--color-result-description-highlight-font);
  170. background: inherit;
  171. font-weight: bold;
  172. }
  173. }
  174. .codelines {
  175. .highlight {
  176. color: inherit;
  177. background: inherit;
  178. font-weight: normal;
  179. }
  180. }
  181. .url_wrapper {
  182. display: flex;
  183. font-size: 1rem;
  184. color: var(--color-result-url-font);
  185. flex-wrap: nowrap;
  186. overflow: hidden;
  187. flex-direction: row;
  188. margin: 0;
  189. padding: 0;
  190. .url_o1 {
  191. white-space: nowrap;
  192. flex-shrink: 1;
  193. }
  194. .url_o1::after {
  195. content: " ";
  196. width: 1ch;
  197. display: inline-block;
  198. }
  199. .url_o2 {
  200. overflow: hidden;
  201. white-space: nowrap;
  202. flex-basis: content;
  203. flex-grow: 0;
  204. flex-shrink: 1;
  205. text-align: right;
  206. .url_i2 {
  207. float: right;
  208. }
  209. }
  210. }
  211. .published_date {
  212. font-size: 0.8em;
  213. color: var(--color-result-publishdate-font);
  214. }
  215. img {
  216. &.thumbnail {
  217. .ltr-float-left();
  218. padding-top: 0.6rem;
  219. .ltr-padding-right(1rem);
  220. width: 20rem;
  221. height: unset; // remove heigth value that was needed for lazy loading
  222. }
  223. &.image {
  224. .ltr-float-left();
  225. padding-top: 0.6rem;
  226. .ltr-padding-right(1rem);
  227. width: 7rem;
  228. max-height: 7rem;
  229. object-fit: scale-down;
  230. object-position: right top;
  231. }
  232. }
  233. .break {
  234. clear: both;
  235. }
  236. }
  237. .category-videos,
  238. .category-news,
  239. .category-map,
  240. .category-music,
  241. .category-files,
  242. .category-social {
  243. border: 1px solid var(--color-result-border);
  244. margin: 1rem 0;
  245. .rounded-corners;
  246. }
  247. .category-social .image {
  248. width: auto !important;
  249. min-width: 48px;
  250. min-height: 48px;
  251. padding: 0 5px 25px 0 !important;
  252. }
  253. .audio-control audio {
  254. width: 100%;
  255. padding: 10px 0 0 0;
  256. }
  257. .embedded-content iframe {
  258. width: 100%;
  259. padding: 10px 0 0 0;
  260. }
  261. .result-videos .content {
  262. overflow: hidden;
  263. }
  264. .result-videos .embedded-video iframe {
  265. width: 100%;
  266. aspect-ratio: 16 / 9;
  267. padding: 10px 0 0 0;
  268. }
  269. @supports not (aspect-ratio: 1 / 1) {
  270. // support older browsers which do not have aspect-ratio
  271. // https://caniuse.com/?search=aspect-ratio
  272. .result-videos .embedded-video iframe {
  273. height: calc(@results-width * 9 / 16);
  274. }
  275. }
  276. .engines {
  277. .ltr-float-right();
  278. color: var(--color-result-engines-font);
  279. span {
  280. font-size: smaller;
  281. margin-top: 0;
  282. margin-bottom: 0;
  283. .ltr-margin-right(0.5rem);
  284. .ltr-margin-left(0);
  285. }
  286. }
  287. .small_font {
  288. font-size: 0.8em;
  289. }
  290. .highlight {
  291. color: var(--color-result-link-font-highlight);
  292. background: inherit;
  293. }
  294. .empty_element {
  295. font-style: italic;
  296. }
  297. .result-images {
  298. display: inline-block;
  299. margin: 0;
  300. padding: 0;
  301. position: relative;
  302. max-height: 200px;
  303. border: none !important;
  304. img {
  305. float: inherit;
  306. margin: 0.125rem;
  307. padding: 0;
  308. border: none;
  309. max-height: 200px;
  310. background: var(--color-result-image-background);
  311. }
  312. span.title {
  313. display: none;
  314. color: var(--color-result-image-span-font);
  315. }
  316. &:hover span.title {
  317. display: block;
  318. position: absolute;
  319. bottom: 0;
  320. .ltr-right(0);
  321. padding: 4px;
  322. margin-top: 0;
  323. .ltr-margin-right(0);
  324. margin-bottom: 4px;
  325. .ltr-margin-left(4px);
  326. // color: @color-result-image-span-font;
  327. background-color: var(--color-result-image-span-background-hover);
  328. font-size: 0.7em;
  329. }
  330. }
  331. .result-map {
  332. img.image {
  333. .ltr-float-right() !important;
  334. height: 100px !important;
  335. width: auto !important;
  336. }
  337. table {
  338. font-size: 0.9em;
  339. width: auto;
  340. border-collapse: separate;
  341. border-spacing: 0 0.35rem;
  342. th {
  343. font-weight: inherit;
  344. width: 17rem;
  345. vertical-align: top;
  346. .ltr-text-align-left();
  347. }
  348. td {
  349. vertical-align: top;
  350. .ltr-text-align-left();
  351. }
  352. }
  353. }
  354. .hidden {
  355. display: none !important;
  356. }
  357. #results {
  358. margin-top: 1rem;
  359. .ltr-margin-right(2rem);
  360. margin-bottom: 0;
  361. .ltr-margin-left(@results-offset);
  362. display: grid;
  363. grid-template-columns: @results-width 25rem;
  364. grid-template-rows: min-content min-content 1fr min-content;
  365. gap: 0 @results-gap;
  366. grid-template-areas:
  367. "corrections sidebar"
  368. "answers sidebar"
  369. "urls sidebar"
  370. "pagination sidebar";
  371. }
  372. #results #sidebar *:first-child,
  373. #results #urls *:first-child {
  374. margin-top: 0;
  375. }
  376. #urls {
  377. padding: 0;
  378. grid-area: urls;
  379. }
  380. #suggestions {
  381. .wrapper {
  382. display: flex;
  383. flex-flow: row wrap;
  384. justify-content: flex-end;
  385. form {
  386. display: inline-block;
  387. flex: 1 1 50%;
  388. }
  389. }
  390. }
  391. #suggestions,
  392. #infoboxes {
  393. input {
  394. padding: 0;
  395. margin: 3px;
  396. font-size: 0.9em;
  397. display: inline-block;
  398. background: transparent;
  399. color: var(--color-result-search-url-font);
  400. cursor: pointer;
  401. }
  402. input[type="submit"],
  403. .infobox .url a {
  404. color: var(--color-result-link-font);
  405. text-decoration: none;
  406. font-size: 0.9rem;
  407. &:hover {
  408. text-decoration: underline;
  409. }
  410. }
  411. }
  412. #corrections {
  413. grid-area: corrections;
  414. display: flex;
  415. flex-flow: row wrap;
  416. margin: 0 0 1em 0;
  417. h4,
  418. input[type="submit"] {
  419. display: inline-block;
  420. padding: 0.5rem;
  421. margin: 0.5rem;
  422. }
  423. input[type="submit"] {
  424. font-size: 0.8rem;
  425. .rounded-corners-tiny;
  426. }
  427. }
  428. #suggestions .title,
  429. #search_url .title,
  430. #apis .title {
  431. margin: 2em 0 0.5em 0;
  432. color: var(--color-base-font);
  433. }
  434. #answers {
  435. grid-area: answers;
  436. border: 1px solid var(--color-answer-border);
  437. background: var(--color-answer-background);
  438. padding: @result-padding;
  439. margin: 1rem 0;
  440. margin-top: 0;
  441. color: var(--color-answer-font);
  442. .rounded-corners;
  443. h4 {
  444. display: none;
  445. }
  446. }
  447. #infoboxes {
  448. form {
  449. min-width: 210px;
  450. }
  451. }
  452. #sidebar {
  453. grid-area: sidebar;
  454. word-wrap: break-word;
  455. color: var(--color-sidebar-font);
  456. .infobox {
  457. margin: 10px 0 10px;
  458. border: 1px solid var(--color-sidebar-border);
  459. padding: 1rem;
  460. font-size: 0.9em;
  461. .rounded-corners;
  462. h2 {
  463. margin: 0 0 0.5em 0;
  464. }
  465. img {
  466. max-width: 100%;
  467. max-height: 12em;
  468. display: block;
  469. margin: 0 auto;
  470. padding: 0;
  471. }
  472. dl {
  473. margin: 0.5em 0;
  474. }
  475. dt {
  476. display: inline;
  477. margin-top: 0.5em;
  478. .ltr-margin-right(0.25em);
  479. margin-bottom: 0.5em;
  480. .ltr-margin-left(0);
  481. padding: 0;
  482. font-weight: bold;
  483. }
  484. dd {
  485. display: inline;
  486. margin: 0.5em 0;
  487. padding: 0;
  488. }
  489. input {
  490. font-size: 1em;
  491. }
  492. br {
  493. clear: both;
  494. }
  495. .attributes,
  496. .urls {
  497. clear: both;
  498. }
  499. }
  500. }
  501. #search_url {
  502. margin-top: 8px;
  503. div.selectable_url {
  504. pre {
  505. width: 200em;
  506. }
  507. }
  508. }
  509. #linkto_preferences {
  510. position: absolute;
  511. .ltr-right(1.8rem);
  512. top: 2.2rem;
  513. padding: 0;
  514. border: 0;
  515. display: block;
  516. font-size: 1.2em;
  517. color: var(--color-search-font);
  518. a:link *,
  519. a:hover *,
  520. a:visited *,
  521. a:active * {
  522. color: var(--color-search-font);
  523. }
  524. }
  525. #pagination {
  526. grid-area: pagination;
  527. br {
  528. clear: both;
  529. }
  530. }
  531. #apis {
  532. margin-top: 8px;
  533. clear: both;
  534. }
  535. #backToTop {
  536. border: 1px solid var(--color-backtotop-border);
  537. margin: 0;
  538. padding: 0;
  539. font-size: 1em;
  540. background: var(--color-backtotop-background);
  541. position: fixed;
  542. bottom: 8rem;
  543. .ltr-left(@results-width + @results-offset + (0.5 * @results-gap - 1.2em));
  544. transition: opacity 0.5s;
  545. opacity: 0;
  546. .rounded-corners;
  547. a {
  548. display: block;
  549. margin: 0;
  550. padding: 0.7em;
  551. }
  552. a,
  553. a:visited,
  554. a:hover,
  555. a:active {
  556. color: var(--color-backtotop-font);
  557. }
  558. }
  559. #results.scrolling #backToTop {
  560. opacity: 1;
  561. }
  562. @media screen and (max-width: @tablet) {
  563. .page_with_header {
  564. margin: 2rem 0.5rem;
  565. width: auto;
  566. }
  567. #infoboxes {
  568. position: inherit;
  569. max-width: inherit;
  570. .infobox {
  571. clear: both;
  572. img {
  573. .ltr-float-left();
  574. max-width: 10em;
  575. margin-top: 0.5em;
  576. .ltr-margin-right(0.5em);
  577. margin-bottom: 0.5em;
  578. .ltr-margin-left(0);
  579. }
  580. }
  581. }
  582. #sidebar {
  583. margin-bottom: @results-margin;
  584. padding: 0;
  585. float: none;
  586. border: none;
  587. width: auto;
  588. input {
  589. border: 0;
  590. }
  591. }
  592. #apis {
  593. display: none;
  594. }
  595. #search_url {
  596. display: none;
  597. }
  598. .result {
  599. .thumbnail {
  600. max-width: 98%;
  601. }
  602. .url {
  603. span.url {
  604. display: block;
  605. white-space: nowrap;
  606. text-overflow: ellipsis;
  607. overflow: hidden;
  608. width: 100%;
  609. }
  610. }
  611. .engines {
  612. .ltr-float-right();
  613. padding: 0 0 3px 0;
  614. }
  615. }
  616. .result-images {
  617. border-bottom: none !important;
  618. }
  619. .image_result {
  620. max-width: 98%;
  621. img {
  622. max-width: 98%;
  623. }
  624. }
  625. #backToTop {
  626. display: none;
  627. }
  628. #pagination {
  629. margin: 2rem 0 0 0 !important;
  630. }
  631. #main_results div#results {
  632. margin: 1rem auto 0 auto;
  633. justify-content: center;
  634. display: grid;
  635. grid-template-columns: @results-width;
  636. grid-template-rows: min-content min-content min-content 1fr min-content min-content;
  637. gap: 0;
  638. grid-template-areas:
  639. "corrections"
  640. "answers"
  641. "sidebar"
  642. "urls"
  643. "pagination";
  644. }
  645. }
  646. #main_results div#results.only_template_images {
  647. margin: 1rem @results-tablet-offset 0 @results-tablet-offset;
  648. display: grid;
  649. grid-template-columns: 100%;
  650. grid-template-rows: min-content min-content 1fr min-content min-content;
  651. gap: 0;
  652. grid-template-areas:
  653. "corrections"
  654. "urls"
  655. "answers"
  656. "sidebar"
  657. "pagination";
  658. #urls {
  659. width: inherit;
  660. margin: 0;
  661. }
  662. #backToTop {
  663. .ltr-left(auto);
  664. .ltr-right(1rem);
  665. }
  666. #pagination {
  667. .ltr-margin-right(4rem);
  668. }
  669. }
  670. @media screen and (max-width: @phone) {
  671. #main_results div#results {
  672. grid-template-columns: 100%;
  673. margin: 2rem @results-tablet-offset 0 @results-tablet-offset;
  674. }
  675. #linkto_preferences {
  676. top: 0.8rem;
  677. .ltr-right(0.7rem);
  678. }
  679. #main_index #linkto_preferences {
  680. top: 0.5rem;
  681. .ltr-right(0.5rem);
  682. }
  683. #results {
  684. margin: 0;
  685. padding: 0;
  686. }
  687. #pagination {
  688. margin: 2rem 1rem 0 1rem !important;
  689. }
  690. article[data-vim-selected] {
  691. border: 1px solid var(--color-result-vim-arrow);
  692. .rounded-corners;
  693. }
  694. .result {
  695. border: 1px solid var(--color-result-border);
  696. margin: 1rem 0;
  697. .rounded-corners;
  698. }
  699. .result-images {
  700. margin: 0;
  701. padding: 0;
  702. border: none;
  703. }
  704. }
  705. @media screen and (max-width: @small-phone) {
  706. .result-videos {
  707. img.thumbnail {
  708. float: none !important;
  709. }
  710. .content {
  711. overflow: inherit;
  712. }
  713. }
  714. }
  715. pre code {
  716. white-space: pre-wrap;
  717. }