style-center.less 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. /*
  2. --center-page-width overrides the less variable @results-width when the results are centered
  3. see the CSS rules for #results in style.less ( grid-template-columns and gap).
  4. In this file, the --center-page-width values comes from the Oscar theme (Bootstrap 3).
  5. All rules starts with ".center-aligment-yes #main_results" to be enabled only
  6. on the /search URL and when the "center alignment" preference is enabled.
  7. */
  8. @media screen and (min-width: @phone) {
  9. .center-aligment-yes #main_results {
  10. --center-page-width: 48rem;
  11. }
  12. }
  13. @media screen and (min-width: 62rem) {
  14. .center-aligment-yes #main_results {
  15. --center-page-width: 60rem;
  16. }
  17. }
  18. @media screen and (min-width: @tablet) {
  19. .center-aligment-yes #main_results {
  20. --center-page-width: 73rem;
  21. }
  22. }
  23. @media screen and (min-width: @phone) and (max-width: @tablet) {
  24. // any change must be reset in @media screen and (min-width: @tablet) { ... }
  25. .center-aligment-yes #main_results {
  26. #results {
  27. grid-template-columns: 60% calc(40% - @results-gap);
  28. margin-left: 0;
  29. margin-right: 0;
  30. }
  31. #urls {
  32. .ltr-margin-left(3rem);
  33. }
  34. #sidebar {
  35. .ltr-margin-right(1rem);
  36. }
  37. #backToTop {
  38. .ltr-left(calc(60% + 1rem));
  39. }
  40. }
  41. }
  42. @media screen and (min-width: @tablet) {
  43. .center-aligment-yes #main_results {
  44. display: flex;
  45. flex-direction: column;
  46. align-items: center;
  47. #search {
  48. width: 100%;
  49. display: flex;
  50. flex-direction: column;
  51. align-items: center;
  52. }
  53. #search_header {
  54. grid-template-columns: calc(50% - 4.5rem - var(--center-page-width) / 2) 3rem var(--center-page-width);
  55. grid-template-areas: "na logo search" "na spacer categories";
  56. column-gap: 1.2rem; // from search.less
  57. width: 100%;
  58. padding-left: 0;
  59. padding-right: 0;
  60. }
  61. .search_filters {
  62. .ltr-margin-left(0.5rem);
  63. width: var(--center-page-width);
  64. }
  65. #results {
  66. // from style.less (when screen width = @tablet, reset layout from tablet)
  67. .ltr-margin-right(2rem);
  68. .ltr-margin-left(@results-offset);
  69. //
  70. &.only_template_images,
  71. &.image-detail-open {
  72. // * grid-template-columns and .ltr-margin-left are set in style.less
  73. // * With .image-detail-open.only_template_images, the width is set in detail.less
  74. // * #results is going to be centered because of the #main_results rules,
  75. // align-self aligns the results on the left or right according to the language.
  76. align-self: flex-start;
  77. }
  78. &:not(.only_template_images):not(.image-detail-open) {
  79. // the gap is set in style.less
  80. .ltr-margin-left(1.5rem);
  81. grid-template-columns: calc(var(--center-page-width) - @results-gap - @results-sidebar-width) @results-sidebar-width;
  82. #backToTop {
  83. .ltr-left(calc(50% - @results-sidebar-width - @results-gap + 1rem + var(--center-page-width) / 2));
  84. }
  85. }
  86. .result .content {
  87. max-width: inherit;
  88. }
  89. }
  90. // from style.less (when screen width = @tablet, reset layout from tablet)
  91. #urls {
  92. .ltr-margin-left(0);
  93. }
  94. #sidebar {
  95. .ltr-margin-right(0);
  96. }
  97. }
  98. }