style.css 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514
  1. /*
  2. * Sapphire
  3. *
  4. * Copyright (C) 2018 Florrie Haero
  5. * Copyright (C) 2018 Alyssa Rosenzweig
  6. * Copyright (C) 2018 eq
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
  21. *
  22. */
  23. body, html {
  24. width: 100%;
  25. height: 100%;
  26. padding: 0;
  27. margin: 0;
  28. font-family: Cantarell, Lato, -apple-system, BlinkMacSystemFont, sapphire-emoji, sans-serif;
  29. /* We need to establish a font-size globally so we can set min-height correctly. TODO: Do we want a preprocessor of some kind? */
  30. font-size: 1em;
  31. background-color: var(--bg-color);
  32. color: var(--text-color);
  33. /* Don't break the layout */
  34. word-break: break-word;
  35. }
  36. /* Arc Dark */
  37. input, button, textarea {
  38. background-color: var(--button-bg-color) !important;
  39. color: var(--button-text-color) !important;
  40. padding: 0.5em;
  41. /* Nice rounded corners */
  42. border-radius: 0.3em;
  43. border-style: none;
  44. /* Fix the font -- I don't know why this has to be explicit, but hey! */
  45. font-family: Cantarell, Lato, -apple-system, BlinkMacSystemFont, sapphire-emoji, sans-serif;
  46. }
  47. button, input[type=button], input[type=submit] {
  48. cursor: pointer;
  49. }
  50. ::-webkit-scrollbar {
  51. background-color: var(--scroll-color);
  52. }
  53. ::-webkit-scrollbar-thumb {
  54. background-color: var(--scroll-thumb-color);
  55. border-radius: 1em;
  56. }
  57. a, a:visited {
  58. color: var(--link-color);
  59. }
  60. .icon {
  61. height: 0.75em;
  62. width: 0.75em;
  63. }
  64. #app {
  65. position: absolute;
  66. display: flex;
  67. flex-direction: row;
  68. width: 100%;
  69. height: 100%;
  70. }
  71. #app > .pane {
  72. width: 100%;
  73. height: 100%;
  74. display: flex;
  75. flex-direction: column;
  76. }
  77. #buddy-list-pane, #chat-user-list-pane {
  78. min-width: 58px;
  79. max-width: 250px;
  80. background: var(--bg-accent-color);
  81. overflow-x: hidden;
  82. padding: 2px 0;
  83. box-sizing: border-box;
  84. }
  85. #chat-pane {
  86. display: flex;
  87. flex-direction: column;
  88. min-width: 300px;
  89. padding: 4px 20px 4px 20px;
  90. box-sizing: border-box;
  91. }
  92. #app:not(.chat) #chat-user-list-pane {
  93. display: none;
  94. }
  95. .pane-scroller {
  96. flex-grow: 1;
  97. overflow-y: scroll;
  98. }
  99. .pane-footer {
  100. border-top: 1px solid var(--border-color);
  101. font-size: 1.5em;
  102. padding: 5px;
  103. display: flex;
  104. flex-direction: row;
  105. justify-content: space-between;
  106. /* Don't squish */
  107. min-height: 1em;
  108. align-items: center;
  109. }
  110. #buddy-list-pane button {
  111. width: 100%;
  112. }
  113. #add-buddy {
  114. color: var(--text-color) !important;
  115. }
  116. #change-avatar {
  117. color: var(--text-color) !important;
  118. }
  119. .user, #chat-list .chat {
  120. /* You: "Seriously, Florrie? You need display: flex for THIS?!" */
  121. display: flex;
  122. flex-direction: row;
  123. align-items: center;
  124. color: inherit;
  125. text-decoration: none;
  126. height: 40px;
  127. padding: 0 8px;
  128. box-sizing: border-box;
  129. }
  130. .user:focus:not(.selected), #chat-list .chat:focus:not(.selected) {
  131. background-color: var(--chat-switch-color);
  132. filter: brightness(1.4);
  133. }
  134. .user.selected, #chat-list .chat.selected {
  135. background-color: var(--accent-button-bg-color);
  136. color: var(--accent-button-text-color);
  137. }
  138. .user.selected .user-name, #chat-list .chat.selected .chat-name {
  139. color: var(--select-text-color);
  140. }
  141. /* For unselected, unread bolds, typing greens. Unread implies not selected;
  142. * typing may or may not be selected. Unread but not typing is blued, as per
  143. * Pidgin conventions */
  144. .user.unread {
  145. font-weight: 800;
  146. }
  147. .user.typing:not(.selected) {
  148. color: var(--buddy-typing-color);
  149. }
  150. .user.unread:not(.typing) .user-name {
  151. color: var(--buddy-unread-color);
  152. }
  153. .user-avatar {
  154. /* min so that it works with flex - otherwise it gets shrunk to the size
  155. * of the img, which makes the user's name appear offset to be closer to
  156. * the image. */
  157. min-width: 30px;
  158. height: 30px;
  159. }
  160. .inner-avatar {
  161. width: 100%;
  162. height: auto;
  163. }
  164. .user-avatar .inner-avatar {
  165. max-width: 30px;
  166. max-height: 30px;
  167. border-radius: 2px;
  168. }
  169. .user-name, .chat-name {
  170. flex-grow: 1;
  171. overflow: hidden;
  172. text-overflow: ellipsis;
  173. margin-left: 8px;
  174. margin-right: 4px;
  175. white-space: nowrap;
  176. }
  177. /* Needs to be overrided explicitly due to a:visited nonsense */
  178. .user:not([data-status-id=offline]) {
  179. color: var(--text-color) !important;
  180. }
  181. .user[data-status-id=offline] {
  182. color: var(--text-disabled-color);
  183. }
  184. #chat-list .chat {
  185. color: var(--text-color);
  186. }
  187. /* Status colors themselves, besdies the grey already specified */
  188. .status-online, .status-available {
  189. color: var(--status-online-color);
  190. }
  191. .status-away {
  192. color: var(--status-away-color);
  193. }
  194. .status-dnd {
  195. color: var(--status-dnd-color);
  196. }
  197. .user[data-status-id=offline] .user-avatar .inner-avatar {
  198. filter: saturate(0);
  199. opacity: 0.8;
  200. }
  201. .group-heading {
  202. border-bottom: 1px solid var(--border-color);
  203. padding-left: 4px;
  204. font-weight: 800;
  205. margin-top: 4px;
  206. }
  207. #message-list-container {
  208. padding: 10px;
  209. flex-grow: 1;
  210. overflow-x: hidden;
  211. overflow-y: scroll;
  212. }
  213. /* Focusing on the message list container is just used to redirect focus to
  214. * the input text field, since logically these are the same. Accordingly,
  215. * disable the outline on both
  216. */
  217. #message-list-container:focus, input[data-id=input]:focus {
  218. outline: none;
  219. }
  220. #chat-input-area {
  221. padding: 10px;
  222. border-top: 1px solid var(--border-color);
  223. }
  224. #chat-form {
  225. display: flex;
  226. flex-direction: row;
  227. /* Corresponds to font size + padding */
  228. min-height: 1.5em;
  229. }
  230. #chat-form textarea {
  231. width: 100%;
  232. min-width: 0;
  233. flex-grow: 1;
  234. resize: none;
  235. margin-right: 6px;
  236. box-sizing: content-box;
  237. }
  238. input[data-id=input] {
  239. flex-grow: 1;
  240. margin-right: 5px;
  241. }
  242. #typing-indicator {
  243. margin-top: 4px;
  244. font-size: 0.7em;
  245. height: 0.7em;
  246. opacity: 0.8;
  247. }
  248. .message-group {
  249. padding: 10px 0;
  250. }
  251. .message-group:not(:first-child) {
  252. border-top: 1px solid var(--message-border-color);
  253. }
  254. .message-group {
  255. display: flex;
  256. flex-direction: row;
  257. }
  258. .message-group-avatar .inner-avatar {
  259. width: 40px;
  260. height: 40px;
  261. margin-right: 12px;
  262. border-radius: 3px;
  263. }
  264. .message {
  265. margin-bottom: 2px;
  266. }
  267. .message-author {
  268. font-weight: 800;
  269. }
  270. .message-content {
  271. white-space: pre-wrap;
  272. }
  273. /* DO NOT CHANGE this max-width value without updating the MOBILE_WIDTH JS constant! */
  274. @media only screen and (max-width: 600px) {
  275. #app.show-chat-area > #buddy-list-pane {
  276. display: none;
  277. }
  278. #app.show-buddy-list > #chat-pane {
  279. display: none;
  280. }
  281. #app.show-buddy-list > #chat-user-list-pane {
  282. display: none;
  283. }
  284. #buddy-list-pane {
  285. max-width: 100%;
  286. }
  287. #room-back {
  288. display: flex !important;
  289. }
  290. }
  291. #app:not(.show-chat-user-list) > #chat-user-list-pane {
  292. display: none;
  293. }
  294. #room-info {
  295. display: flex;
  296. flex-direction: row;
  297. min-width: 0;
  298. flex-shrink: 0;
  299. padding-bottom: 3px;
  300. border-bottom: 1px solid var(--border-color);
  301. }
  302. #room-info-content {
  303. flex-grow: 1;
  304. min-width: 0;
  305. display: flex;
  306. flex-direction: row;
  307. }
  308. .room-name-topic-container {
  309. display: flex;
  310. flex-direction: column;
  311. }
  312. #room-info-content .room-name {
  313. font-size: 1.5em;
  314. font-weight: bold;
  315. }
  316. #room-info-content .room-name, #room-info-content .room-topic {
  317. white-space: nowrap;
  318. overflow-x: hidden;
  319. text-overflow: ellipsis;
  320. }
  321. .room-avatar {
  322. height: 100%;
  323. width: 40px;
  324. margin-right: 10px;
  325. display: flex;
  326. align-items: center;
  327. }
  328. .room-button {
  329. display: flex;
  330. flex-shrink: 0;
  331. font-size: 1.5em;
  332. align-items: center;
  333. justify-content: center;
  334. padding: 0 10px;
  335. color: var(--button-text-color) !important;
  336. text-decoration: none;
  337. }
  338. .room-button > img {
  339. height: 1.75em;
  340. width: auto;
  341. flex-shrink: 0;
  342. }
  343. #room-back {
  344. display: none;
  345. }
  346. #app:not(.chat) #toggle-chat-user-list {
  347. display: none;
  348. }
  349. /* Modals */
  350. #modal-screen {
  351. background-color: var(--modal-screen-bg-color);
  352. }
  353. #modal-screen:not(.visible) { display: none; }
  354. /* Login screen is not a modal, but follows the same "center the content" rules. */
  355. #modal-screen, #login-screen {
  356. position: absolute;
  357. width: 100%;
  358. height: 100%;
  359. /* Yes, more flex. Seriously, this is the one case where it is MEANT to be useful. */
  360. display: flex;
  361. flex-direction: column;
  362. justify-content: center;
  363. align-items: center;
  364. }
  365. #modal-content {
  366. padding: 20px;
  367. background-color: var(--modal-content-bg-color);
  368. color: var(--modal-text-color);
  369. border-radius: 5px;
  370. box-shadow: 0 0 8px black;
  371. max-width: 600px;
  372. margin: 10px;
  373. }
  374. #modal-content .actions {
  375. width: 100%;
  376. display: flex;
  377. flex-direction: row;
  378. }
  379. #modal-content .actions input {
  380. flex-grow: 1;
  381. margin: 5px;
  382. }
  383. #modal-content input[type=submit] {
  384. background-color: var(--accent-button-bg-color) !important;
  385. color: var(--accent-button-text-color);
  386. }
  387. /* Login screen! */
  388. #login-screen {
  389. background-color: var(--bg-color);
  390. }
  391. #login-screen:not(.visible),
  392. #login-status:not(.visible),
  393. #login-form:not(.visible) { display: none; }
  394. #login-content, #login-form {
  395. text-align: center;
  396. }
  397. #login-content h1, #modal-content h1 {
  398. margin-top: 0;
  399. margin-bottom: 0.4em;
  400. }
  401. #login-content label, #modal-content label {
  402. display: block;
  403. margin-bottom: 0.8em;
  404. }
  405. #login-content input[type=submit] {
  406. width: 100%;
  407. background-color: var(--accent-button-bg-color) !important;
  408. color: var(--accent-button-text-color) !important;
  409. }