styles.css 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. /* Reset */
  2. *,
  3. *::before,
  4. *::after {
  5. box-sizing: border-box;
  6. }
  7. * {
  8. margin: 0;
  9. padding: 0;
  10. }
  11. html {
  12. color-scheme: dark light;
  13. }
  14. body {
  15. min-height: 100vh;
  16. }
  17. img,
  18. picture,
  19. video,
  20. canvas,
  21. svg {
  22. display: block;
  23. max-width: 100%;
  24. }
  25. input,
  26. button,
  27. textarea,
  28. select {
  29. font: inherit;
  30. }
  31. /* Colors */
  32. :root {
  33. --color-dark: #1f2123;
  34. --color-light: #e8e6e3;
  35. }
  36. :root {
  37. /* separated since these are used by the actual script */
  38. --highlight: var(--color-light);
  39. --background: var(--color-dark);
  40. --shadow-component: 255;
  41. --shadow: rgb(
  42. var(--shadow-component),
  43. var(--shadow-component),
  44. var(--shadow-component),
  45. 0.2
  46. );
  47. }
  48. /* Font */
  49. body {
  50. font-family: Arial, Helvetica, sans-serif;
  51. }
  52. /* Composition */
  53. .flex {
  54. display: flex;
  55. gap: var(--gap, 1rem);
  56. }
  57. .even {
  58. justify-content: space-between;
  59. align-items: stretch;
  60. }
  61. .wrap {
  62. flex-wrap: wrap;
  63. }
  64. .col {
  65. flex-direction: column;
  66. }
  67. .grid {
  68. display: grid;
  69. gap: var(--gap, 1rem);
  70. }
  71. .flow > * + * {
  72. margin-block-start: var(--flow-space, 1rem);
  73. }
  74. .no-gap {
  75. --gap: 0px;
  76. }
  77. .small-gap {
  78. --gap: 0.5rem;
  79. }
  80. .big-gap {
  81. --gap: 1.5rem;
  82. }
  83. .small-flow-space {
  84. --flow-space: 0.5rem;
  85. }
  86. .section {
  87. padding-block-start: var(--flow-space, 1rem);
  88. padding-inline: var(--flow-space-inline, 1ch);
  89. }
  90. /* Utility */
  91. .emphasis {
  92. font-size: 1.125rem;
  93. font-weight: 600;
  94. }
  95. .center {
  96. text-align: center;
  97. margin-inline: auto;
  98. }
  99. .block-center {
  100. margin-block: auto;
  101. }
  102. .right {
  103. text-align: end;
  104. }
  105. .ellipsis {
  106. overflow: hidden;
  107. text-overflow: ellipsis;
  108. white-space: nowrap;
  109. }
  110. .margin-after {
  111. margin-block-end: 0.5rem;
  112. }
  113. .pill-shape {
  114. border-radius: 100vmax;
  115. }
  116. .highlight-border {
  117. border: 1px solid var(--highlight);
  118. }
  119. /* Block */
  120. body {
  121. color: var(--highlight);
  122. background-color: var(--background);
  123. accent-color: var(--highlight);
  124. transition: accent-color 250ms, color 250ms, background-color 250ms;
  125. display: grid;
  126. grid-template-columns: 14rem 1fr 8rem;
  127. }
  128. body > * + :not(#sidebar) {
  129. border-inline-start: 1px solid var(--highlight);
  130. }
  131. hr {
  132. color: var(--highlight);
  133. }
  134. button {
  135. border-radius: 100vmax;
  136. padding-block: 0.25rem;
  137. border: 1px solid var(--highlight);
  138. transition: background-color 100ms;
  139. }
  140. button:hover {
  141. box-shadow: 0 0 4px 2px var(--shadow);
  142. }
  143. button.color-select {
  144. background-color: var(--button-bg);
  145. }
  146. button.color-select:hover {
  147. background-color: var(--button-bg-hover);
  148. }
  149. #prevColors button {
  150. width: 100%;
  151. margin-block-end: 0.5ch;
  152. }
  153. #targetSelect input[type="text"] {
  154. text-align: center;
  155. min-width: 0px;
  156. }
  157. #targetSelect input[type="color"] {
  158. flex: 0 0 2rem;
  159. }
  160. :is(#cls-fn-mount, #cls-metric-mount) form {
  161. transition: opacity 200ms;
  162. }
  163. [data-faded="true"] {
  164. opacity: 25%;
  165. }
  166. #color-results {
  167. margin-inline-start: 1ch;
  168. }
  169. #nameSearch input {
  170. text-align: center;
  171. padding-block: 0.5ch;
  172. }
  173. .toggle-label {
  174. padding: 0 0.625ch 0.125rem;
  175. color: var(--shadow);
  176. border-color: var(--shadow);
  177. transition: color 200ms, border-color 200ms, background-color 200ms;
  178. }
  179. :is(input[type="checkbox"], input[type="radio"]):checked + .toggle-label {
  180. background-color: var(--highlight);
  181. color: var(--background);
  182. border-color: var(--highlight);
  183. }
  184. /* Pokemon Tiles */
  185. .pkmn-tile {
  186. max-width: 24ch;
  187. padding-inline: 0.5ch;
  188. --tile-block-padding: 0.25rem;
  189. --tile-border-radius: 8px;
  190. transition: transform 250ms ease-out;
  191. }
  192. .pkmn-tile:hover {
  193. transform: scale(105%) translateX(-3%) translateY(-5%);
  194. }
  195. .pkmn-tile .pkmn-info {
  196. /* no block-start padding here, this makes the
  197. images look like they go right up to the border */
  198. padding: 0 0.5ch var(--tile-block-padding);
  199. border-radius: var(--tile-border-radius);
  200. box-shadow: 4px 4px 2px var(--shadow);
  201. margin-block-start: 0.25rem;
  202. }
  203. .pkmn-tile .cluster-buttons {
  204. --gap: 0.125rem;
  205. justify-content: center;
  206. /* but here we put the block-start padding back to
  207. fix the vertical centering of the cluster buttons */
  208. margin-block-start: var(--tile-block-padding);
  209. margin-inline-start: 0.5ch;
  210. padding-inline: 0.25ch;
  211. border-radius: var(--tile-border-radius);
  212. background-color: var(--shadow);
  213. box-shadow: 0px 0px 8px var(--shadow);
  214. }
  215. .pkmn-tile img {
  216. height: 64px;
  217. }
  218. .pkmn-tile button {
  219. font-size: 0.85rem;
  220. font-weight: 600;
  221. min-width: 12ch;
  222. }
  223. .pkmn-tile button[data-best="true"]::before {
  224. content: "▸";
  225. display: inline-block;
  226. width: 1ch;
  227. margin-inline: 0.25ch;
  228. }
  229. /* Sort Function Controls */
  230. .fn-control .fn-minmax {
  231. padding: 0.25rem 0.5ch;
  232. display: inline-flex;
  233. justify-content: center;
  234. background-color: var(--shadow);
  235. /* TODO might want to bring back that shifting pill */
  236. }
  237. .fn-control .fn-minmax span {
  238. text-transform: capitalize;
  239. }
  240. .fn-control .fn-body {
  241. --gap: 0.25ch;
  242. margin-block: 0.5rem;
  243. justify-content: center;
  244. align-items: center;
  245. }
  246. .fn-control input[type="checkbox"] {
  247. display: none;
  248. }
  249. .fn-control .toggle-label:first-child {
  250. /* only affects the fake label on the cluster function */
  251. color: inherit;
  252. background-color: inherit;
  253. border: none;
  254. }
  255. .fn-fraction > *:first-child {
  256. /* this feels a little fragile */
  257. padding-bottom: 6px;
  258. margin-bottom: 4px;
  259. border-block-end: 1px solid var(--highlight);
  260. }
  261. /* Metric Controls */
  262. .metric-fields {
  263. border: none;
  264. }
  265. .metric-fields :is(legend, select:disabled, input[type="radio"]) {
  266. display: none;
  267. }
  268. .metric-fields select {
  269. width: 100%;
  270. padding: 0.25rem 1ch;
  271. }