From 1c910248bf382b0fbd77d17eeada0dd240d9f1c3 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 7 Mar 2022 16:54:45 -0600 Subject: [PATCH 01/10] Set Tailwind colors with CSS variables --- app/styles/themes.scss | 46 ++++++++++++++++++++++++++++++++++++++++- tailwind.config.js | Bin 2173 -> 2147 bytes 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/app/styles/themes.scss b/app/styles/themes.scss index d238081612..112c2abc1d 100644 --- a/app/styles/themes.scss +++ b/app/styles/themes.scss @@ -26,6 +26,50 @@ Examples: body, .site-preview { + // Tailwind color variables + --color-gray-50: 249 250 251; + --color-gray-100: 243 244 246; + --color-gray-200: 229 231 235; + --color-gray-300: 209 213 219; + --color-gray-400: 156 163 175; + --color-gray-500: 107 114 128; + --color-gray-600: 75 85 99; + --color-gray-700: 55 65 81; + --color-gray-800: 31 41 55; + --color-gray-900: 17 24 39; + --color-primary-50: 238 242 255; + --color-primary-100: 224 231 255; + --color-primary-200: 199 210 254; + --color-primary-300: 165 180 252; + --color-primary-400: 129 140 248; + --color-primary-500: 99 102 241; + --color-primary-600: 84 72 238; + --color-primary-700: 67 56 202; + --color-primary-800: 55 48 163; + --color-primary-900: 49 46 129; + --color-success-50: 240 253 244; + --color-success-100: 220 252 231; + --color-success-200: 187 247 208; + --color-success-300: 134 239 172; + --color-success-400: 74 222 128; + --color-success-500: 34 197 94; + --color-success-600: 22 163 74; + --color-success-700: 21 128 61; + --color-success-800: 22 101 52; + --color-success-900: 20 83 45; + --color-danger-50: 254 242 242; + --color-danger-100: 254 226 226; + --color-danger-200: 254 202 202; + --color-danger-300: 252 165 165; + --color-danger-400: 248 113 113; + --color-danger-500: 239 68 68; + --color-danger-600: 220 38 38; + --color-danger-700: 185 28 28; + --color-danger-800: 153 27 27; + --color-danger-900: 127 29 29; + --color-accent-300: 255 95 135; + --color-accent-500: 255 71 117; + // Primary variables --brand-color: hsl(var(--brand-color_hsl)); --accent-color: hsl(var(--accent-color_hsl)); @@ -82,7 +126,7 @@ body, --input-border-color: #d1d5db; // Typography - --font-sans: 'Inter', Arial, sans-serif; + --font-sans: 'Inter', arial, sans-serif; --font-weight-heading: 700; --font-weight-body: 400; } diff --git a/tailwind.config.js b/tailwind.config.js index 9b88abf0db1da6316192c1dc619adab3dae86380..e697ea7576200deae2899279e1bc997bfd6f8a7d 100644 GIT binary patch literal 2147 zcmbVOTW`}!5Pr|E80l29Q^j$5=p6+Cozns2vd0Lzq5u006mw zuy;6}PN6DNT*v}bp9c8Vq`K0}xh)dzZQD}yaCr5UiviTm{tgK->}_|;)jqaKxk zvBtDYFbviFxH#33I+< z>>?o-M$7d*zJ3mD6PTD?h8J!?xTOZs+-XzogTs$+a6?`J8unSbsCz7(&$8T+u+`63 zx%7~~VfM<+kngUg7V@o%TfRy=$W7zJhLkVB#qH=Wwb-1)<cl;kR{G92T& zRN7D@5Rba?=wKX+vW)llpF0Xq(a}kQz@Q9kYs`=uriqy=IpUz z15lz73uf&f*^x8&==7jmJFvy%DZ5UNPj_6|l3iyf$2+cd#;$|I!%63>Z8ZQ~bHALT zt*~GMGx?)y!D8luY?G7m*^`qajd@qQ$pK)aUW;62e7|ibfPh3n0W0S!*-Y$v%L3^x zgL73fvdD-~%SHc)He@i5D%p2OENzC7KkXmA%w%!%P9!rI`I;N+pU-fq5Wc+adq1hU zGOF);gV`+_nFx4~752|w@Y2uvuJ@b(W|py6*3tDEJjCpUWdIj;Tfl$0y1vJ-ZS%Kh zvrRr%54G`dS~qpJt?u6Zm-`%=wZuaxmqqB-j7!liDc+9VB?i0&Qpr;um6c`^e8a!| z;sx#cy^kHa}bK?kKrAti>#YZP6=nqtXfL@UGvkb@&8I{41?!8 ce+lA+(m4f9?86YVDHW40R~wIG(Ro|^1b6&qZU6uP literal 2173 zcmaKtOK;RL5XbNR6qb4jRNXd?<2*n}JVZqg<-m#);^5fhZ6Mi%I19T}{qER_H}zC2 zR@JUL|M5J29@}lFb`4y?zVC+7kT>Mvj1bvvN7#<9$hYX~TJ-((#l`i-)x-VRHkUul z<>>zQkJ0x_>#M}@^R83yibS#z#zf9I-a~6GE*2q14ggzo{MQ;<>&y$h%iz$x`Fe}3U%ILrJ8b&|&2JcMDadEo0oL9PwP>*EvkgGj zuH%{P)b7mSRA=v82joN7bOZU=c0ZnVcr5e3+WOE|-KjE8hn=R*m9^}fbm@cnB4jfN zw1W4Ap*peCjFi$Vlom;-EVKyehq@KRNk9NP(YSCA2x7>eDISo_ zRig1^c|d|!sg|fb52&Dp)CE$GfLNAk+^h%0)3gAb#{)_kE2KctJRp{{SYW6g5Tgkc zVV(ex*+~foP1G_$u~s@osXQPhwS0IGG_kfBFv^WVU6$+lsi3gMo~ z1EQH=DaPOdQC`GMp{kD)lx3XZevT8Aa+ZW^0zgV^H!y^^s8*|m~27Be&_b58A z3c++4gnII-8hh6}pR!UM9oxu&SS_+WxFDYz_Zg?3>8o#co7%nI^XoUjuU$RBi|Fkr m>gG?qRnnMi-3_gYUd|83X_xWPceaK8{xJJ}zdU< Date: Mon, 7 Mar 2022 17:19:54 -0600 Subject: [PATCH 02/10] Use colors from soapbox.json at runtime --- app/soapbox/actions/soapbox.js | Bin 4214 -> 4242 bytes app/soapbox/containers/soapbox.js | Bin 8418 -> 8669 bytes app/soapbox/utils/theme.js | Bin 2823 -> 3532 bytes app/styles/themes.scss | 44 ------------------------------ 4 files changed, 44 deletions(-) diff --git a/app/soapbox/actions/soapbox.js b/app/soapbox/actions/soapbox.js index 91e1a26f27883e09d6f49d83f26fc9012d89287c..ac8749221ef4f797077026beb89ae3764244a23a 100644 GIT binary patch delta 21 dcmeySFiCO4JQkMxocyB62CNdB=ds-21^`_52lM~{ delta 12 UcmbQF_)THMJeJM7SZ;6w03{;@Z~y=R diff --git a/app/soapbox/containers/soapbox.js b/app/soapbox/containers/soapbox.js index a86573be7529e7fb412fc081e12d8f9011f7f827..c702ea12c642d343eeec565b2f811ead8c2be82a 100644 GIT binary patch delta 235 zcmaFlc-MJ@1gk-2Zb5!gi9)qPa(+&JQE^DVb8)dktwLH+ey)OgaeiV!QhtSgX-Q^I zv3^NLYHsRgQPy^LOE43t(h6Cd22{CoeqLH;x?Xx}iH17FRCP_gl6(|BB& zn1MPcGxAGpzQ&it%mFiNvzd@Oi(fU2tDvT)U{hRDnUkuJnPRIB7FJg%sVqnZa#AZw l^plH=)$OVitcvpUOR81i`f6(vYHjqv8trN~`-n~B0s#7wQ@{WK delta 32 ocmccX{K#>G1nXvR))w~7e7yEdn{)YNnKxe%Qf1j3A>PUb0Kq51pw6dgJQe1I-p{$Q|8l?)wY+$HT?XtSAsZCSCChA2o*Nf5$guT$tXdV^l3 z(zl!#61vE;^xymM{in~{pS!PzQA_z&Hn7WuWN&p|G6@NUyjT;Ue8U9+iKh`HkDxq& z)e^$yxMO_jZXih#2xKEx+bW2#1`O7+DlqtpKmppY*6c9nuT>E`#@Mhy3xYL!u?5pI z&BkMFI`$QQb+$0L%vVB#uPVC~ISb-LV4F^8GTsvk3Iv}vF8n@JG0}o(?x4$gY!K3AG+u&qKRPTp0aQd$0-IFMm8vL zvB?xUdKc#z$u;Zd}fpv}Nd?qi1x(a+KrE!6q8F~txUdw$YlMZrrL!~6} pk&9JcY}nJlk;9sMxVNeIHG1l+jwJ1m7CP?U0f8WhzRBqK<`0Mr>v{kH delta 12 TcmX>j-7dDlh<)>S&a2D-Ap8XR diff --git a/app/styles/themes.scss b/app/styles/themes.scss index 112c2abc1d..97a9b5f95c 100644 --- a/app/styles/themes.scss +++ b/app/styles/themes.scss @@ -26,50 +26,6 @@ Examples: body, .site-preview { - // Tailwind color variables - --color-gray-50: 249 250 251; - --color-gray-100: 243 244 246; - --color-gray-200: 229 231 235; - --color-gray-300: 209 213 219; - --color-gray-400: 156 163 175; - --color-gray-500: 107 114 128; - --color-gray-600: 75 85 99; - --color-gray-700: 55 65 81; - --color-gray-800: 31 41 55; - --color-gray-900: 17 24 39; - --color-primary-50: 238 242 255; - --color-primary-100: 224 231 255; - --color-primary-200: 199 210 254; - --color-primary-300: 165 180 252; - --color-primary-400: 129 140 248; - --color-primary-500: 99 102 241; - --color-primary-600: 84 72 238; - --color-primary-700: 67 56 202; - --color-primary-800: 55 48 163; - --color-primary-900: 49 46 129; - --color-success-50: 240 253 244; - --color-success-100: 220 252 231; - --color-success-200: 187 247 208; - --color-success-300: 134 239 172; - --color-success-400: 74 222 128; - --color-success-500: 34 197 94; - --color-success-600: 22 163 74; - --color-success-700: 21 128 61; - --color-success-800: 22 101 52; - --color-success-900: 20 83 45; - --color-danger-50: 254 242 242; - --color-danger-100: 254 226 226; - --color-danger-200: 254 202 202; - --color-danger-300: 252 165 165; - --color-danger-400: 248 113 113; - --color-danger-500: 239 68 68; - --color-danger-600: 220 38 38; - --color-danger-700: 185 28 28; - --color-danger-800: 153 27 27; - --color-danger-900: 127 29 29; - --color-accent-300: 255 95 135; - --color-accent-500: 255 71 117; - // Primary variables --brand-color: hsl(var(--brand-color_hsl)); --accent-color: hsl(var(--accent-color_hsl)); From 18bad4a5ab9e886a2c45c28480cbdea0b637d0d4 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 21 Mar 2022 18:57:23 -0500 Subject: [PATCH 03/10] Typescript: utils/theme.ts --- app/soapbox/utils/{theme.js => theme.ts} | Bin 3532 -> 3947 bytes 1 file changed, 0 insertions(+), 0 deletions(-) rename app/soapbox/utils/{theme.js => theme.ts} (73%) diff --git a/app/soapbox/utils/theme.js b/app/soapbox/utils/theme.ts similarity index 73% rename from app/soapbox/utils/theme.js rename to app/soapbox/utils/theme.ts index 0f3d63b4fc4c5579962ada7722ac2166dd9b8385..e052a41dcb27500981db4c291af1c540aa3802cb 100644 GIT binary patch delta 570 zcmX>j{aS8$Reoj8nB8Z?Sj4?6$CLfFq6a>0x zvMb{%#`w+e8MiPBYLq4Bl%|4(fs#P$H?Lq`#Ow$ZNKMW!O0j|4kXLD^qmYbj1JG$1 zi7BZ-_hC`HIg;Iz(MSWV0lNy2TQKdIyn#^jMUszm&B4pD+QcN;lV!nAWy$GAsZn+ OQLwe+Qka~`n+*Ugb;ala delta 130 zcmaDYcSd@G(ZtExld~E5CO)~zs5$vG@2{S9$+D+om1^|K)F6{sS From a42ea0961aeef51e8427abb19f6b2dec8f27fcef Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 22 Mar 2022 12:37:57 -0500 Subject: [PATCH 04/10] Generate Tailwind colors from brandColor/accentColor --- app/soapbox/containers/soapbox.js | Bin 8669 -> 8727 bytes app/soapbox/features/ui/components/navbar.tsx | 12 +- app/soapbox/types/colors.ts | 10 ++ app/soapbox/utils/__tests__/colors-test.js | Bin 0 -> 462 bytes app/soapbox/utils/colors.ts | 123 ++++++++++++++++++ app/soapbox/utils/theme.ts | 104 ++++++--------- 6 files changed, 179 insertions(+), 70 deletions(-) create mode 100644 app/soapbox/types/colors.ts create mode 100644 app/soapbox/utils/__tests__/colors-test.js create mode 100644 app/soapbox/utils/colors.ts diff --git a/app/soapbox/containers/soapbox.js b/app/soapbox/containers/soapbox.js index c702ea12c642d343eeec565b2f811ead8c2be82a..aad96badb26df774f56c6d94c9fc1c729fcf176f 100644 GIT binary patch delta 107 zcmccXJl$o3BC9}2Mrv-VbAC>KQE^DVb8zrx9oDt%g6N_elcjj&jTCBX6x5XsOe~C2 tEYx)rit`f-lJYB@^YhX&)AiC*OElCIlao{PO2Ebe6{xFkX5+ms0sy;wBW(Zx delta 75 zcmbR4a@To-A}e=teolT-aY(*%aq(tD*0t=qNCFzg`H2Nd`4!Ijd1;yHdg-Yp8tM>f RbxpmJe6L`Q%?`ZRMF1}_8+`x( diff --git a/app/soapbox/features/ui/components/navbar.tsx b/app/soapbox/features/ui/components/navbar.tsx index 2f6ffe8df1..d9198ecc43 100644 --- a/app/soapbox/features/ui/components/navbar.tsx +++ b/app/soapbox/features/ui/components/navbar.tsx @@ -33,11 +33,13 @@ const Navbar = () => {