style.less 15 KB

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