From abb0a4bae26a446de93542da6673179b5163634f Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Sun, 11 Apr 2021 23:57:39 -0400 Subject: [PATCH] DEV: Add SCSS helper to replace `asset-uri` and `image-uri` (#12664) --- app/assets/images/select2-spinner.gif | Bin 1435 -> 0 bytes app/assets/images/select2.png | Bin 525 -> 0 bytes app/assets/images/select2x2.png | Bin 759 -> 0 bytes app/assets/images/spinner_96.gif | Bin 11405 -> 0 bytes .../stylesheets/common/base/onebox.scss | 12 +++++--- .../stylesheets/common/foundation/mixins.scss | 11 +++++++ lib/stylesheet/functions.rb | 2 ++ lib/stylesheet/importer.rb | 7 ++++- .../images/favicons/discourse.png | Bin .../google_branding/logo_calendar_128px.png | Bin .../google_branding/logo_calendar_48px.png | Bin .../google_branding/logo_docs_48px.png | Bin .../google_branding/logo_drive_48px.png | Bin .../google_branding/logo_forms_48px.png | Bin .../google_branding/logo_sheets_48px.png | Bin .../google_branding/logo_slides_48px.png | Bin .../images/favicons/google_play.png | Bin .../images/favicons/instagram.png | Bin .../images/favicons/pdf_48px.png | Bin .../images/favicons/pdf_64px.png | Bin .../images/favicons/stackexchange.png | Bin spec/components/stylesheet/compiler_spec.rb | 29 ++++++++++++++++++ spec/models/post_analyzer_spec.rb | 2 +- spec/models/post_spec.rb | 2 +- 24 files changed, 58 insertions(+), 7 deletions(-) delete mode 100644 app/assets/images/select2-spinner.gif delete mode 100644 app/assets/images/select2.png delete mode 100644 app/assets/images/select2x2.png delete mode 100644 app/assets/images/spinner_96.gif rename {app/assets => public}/images/favicons/discourse.png (100%) rename {app/assets => public}/images/favicons/google_branding/logo_calendar_128px.png (100%) rename {app/assets => public}/images/favicons/google_branding/logo_calendar_48px.png (100%) rename {app/assets => public}/images/favicons/google_branding/logo_docs_48px.png (100%) rename {app/assets => public}/images/favicons/google_branding/logo_drive_48px.png (100%) rename {app/assets => public}/images/favicons/google_branding/logo_forms_48px.png (100%) rename {app/assets => public}/images/favicons/google_branding/logo_sheets_48px.png (100%) rename {app/assets => public}/images/favicons/google_branding/logo_slides_48px.png (100%) rename {app/assets => public}/images/favicons/google_play.png (100%) rename {app/assets => public}/images/favicons/instagram.png (100%) rename {app/assets => public}/images/favicons/pdf_48px.png (100%) rename {app/assets => public}/images/favicons/pdf_64px.png (100%) rename {app/assets => public}/images/favicons/stackexchange.png (100%) diff --git a/app/assets/images/select2-spinner.gif b/app/assets/images/select2-spinner.gif deleted file mode 100644 index 703391003b296f5abf868210c79a720cea2987b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1435 zcmZvbdrVVj7{y;@;>kLJim9d zQZA0uBLD$U1AtbmEhs3sa^(tx!Dwu3jE#*20Jz=myu3V*$5UQjE|<&se13a-I}F2% zi;LXFC2Cnlx->x}i&-P`gS@}FFJK}S1b|5I+dC8i06yTs>rujyN5@>s(gT{ahndN< z7W_QhnS-uwRN^tkbWqqjnlOi4G)S@?sp8pnOY|@*~0B zft0R1KDn~^B|6EW6P{)Uk6jfUqHzy>#yY)+_a8;X8vuZ_yowfwHvE!SB@@O;ZV5~c z8S;ts6I?~Yxap*WakYv0-cOumJh1dTE9goKT@!>=8Ab{_DotAlkM~|?m>p9B7^Xlk z+iFp|XArC4j=BTl=1<;C4}aU>-!W%<@CeEeG0pxqnDCqd&2e4ArHLyXI5)!51H&_d zNjs^z>=9RISt%%Qx4DqerGYsjgXthVMbtlBjy7G_7i!oH+r6Zk;}v%jm5F1lmBeo0 zbkv1`XH1_zvaeUV*Pjf*t%-ImA)j`0dXnph5_fK{VT#C>RPD}XDW)#{Gu0mr{r63r zg(9{TKZw`GODiO{ICU#KJaMmT*F^@TA&_J~V(7lfuZY<@hW~E1yIO>qHGQW9&^ffK z-!g@<=A!L&V-~8OC>x5bHA}dPR2^WP{{&`FSe|{}FHx-4|!4h8iFPo5P4d^rS_m@oc z+Kt(t+6TW-RBWWJ7>=f+<_Mpj*DnMhFDI`^**b>vN@}(|%KBDv_qQD*5BTSfYSh7E zf4c(5N)w*!pKonwvU4P(@cJ;*W5sIX-uBReuDeVcbtvcE?F%%BRP1gjp?`3VlPZp- z)%X3}2in$|a^e4@SB)cOL8! zQj)L;{q3L%*+3HzLy%G`2a#}bRC2nZfsH+v>yAVgt$!eI0{^n}x;vko)`KfQY%{i| z2MiC(LQ2!DRu855$(FJ#qI|*{27<-Uwn66zgN2GJld!y}n;8tfnWnF}ERQm}s%L>Z&|PmDFHD~EZwW~SdqJ4k0RwCm?kX_vM1ZO92_QVH7T{b zMACM3q4}|IE{oCBT5_0X_4RUD4)~Vo+ox!chnD{B|_^8#ZgXjDpUNhrn2T)=e^<=bwJf=e_(1+Qt1q@MUmr|e!Gflfh9bK5W zN`+GxQ{p4Wl)0`{*vUO!GR7r(F{Y^WxQa11s8wooGmmLidOV`cX8rIT@^c6V%D+o* P00000NkvXXu0mjf9}Mzg diff --git a/app/assets/images/select2x2.png b/app/assets/images/select2x2.png deleted file mode 100644 index e0a62658daefeffef908ec5c4729f85e9349437a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 759 zcmeAS@N?(olHy`uVBq!ia0vp^6+j%o!3-pyx;pL#Qo90tLR{Sod^$Qh+S}WKBoK6V zcJ}x81Gzxp=H>=r0L38;S65eL5wH#r0TisSuLm-EdU_y&$jaK<+90wJ60QKE5uy@E z0=Yny-QC^I&CL+0RjXD(#DQF(INVGi7w9(57kbe^U)Yoc`2{l+G<^6QAn8+$x6|n={{>G>`KXM6-(Rod)3o8jR%|A%oR@_S#5J`*J8HoPgQ1G&o2Nk}z@G$M^i zlxoIONF8lbsRorLm6p>{XK_2{+`r%de?R*^{XTeoUhnIDU4H&-sz-DbAPVp+9H6VK zd;R)#rBXRCFfcSUbocJv`}gnb=;%Cs`t-$%7q4Eunwpw=^XAR$?Cj&mj~5meK79CK zZf)P=;Y)?rBc_fUCU%LIUG)4U|?`?a9CJaczF2Mty^PbV-pe*l9Q8n?b@|> z@7}Detel)2u~=MKSXfk4boA)a($do7$B)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(_Z#0qnm1?{mI66+!#!8Gu6gd8 zXM~~DLrp5Ke5?;Oq+LW1lKKJQxIcbiwih@}CP+&+ZAIvude-bj)Yv)_f7<-yCmK@A z=X>9<{gs8!cPO|2`0tG9{5Np_RiCo@@A^~^RsZjyAm9y83XzVtxOoA%O?*{GpjqsV z?WhYQyH{UNm>*t$Zr#))M8iF+{KYWRA>n3C3?Bd!6$N?o;fBR!0c-a2J<6*Y4kbx7 zH9Ps%XR2YmRE%ar`HK9SH$!|}apd!Xd3;wzILH;F#9(dKTk|nJTz%Du9%Y@&hE)7e zkjBV3##lQ5bPf&xJzoFh={RXM+p!YoI30B7?Fe=+8>aO!_{QgP{h05uh^^||Ew{A! zahn1Oh!Ifl8nPjqvnVMRYC$kz_R}P@PL%QU1_^gDfaA8B%@vR4D2G;n8?OBx+MkQ0 z?w#+?oZNV6+0Y}b$}pf~maFFxGs2CEKKJmHzIAVwq*uPN-o{LPVAyphBGRL^a22Ya z{-l)F-Dz z1KKaWxl{GiT3Ve-AO@YmDwH84n|dKUG1+;8NM0;)(W_>ri))cz+%Dbxpg2U!567x=*x%W;{bwn zTNLnR5Q1tQ%G9J#4Y%li%~6PeMsZbjFje%*;f(oVL%|UiMIjKvZGlm##wHz*JjZyd zK;Pz3I2q~Qf;gRqcAQjZG;bSa=sMu$WH1(OWrt3bkJh7IY`@n@)*(ivDHfb35D+O` zqCzfFJ}F@l@v{t!dAfQh+}xTfs5bx657G2ij|v6pa>>p-TXbpfnIqVCWSu!Sd_BnF zZMSbOkg|JN+1A~Qf6!F&*#hnBD&wb=H}DArQg7Q08%G2& z{iHvTnZ+~LT@Jw8BP{w4gboJwNR9={LbG`B>_E??KFZAa8fo#EHw5A@kn~oSuiUtK F{SQ`dtMUK< diff --git a/app/assets/stylesheets/common/base/onebox.scss b/app/assets/stylesheets/common/base/onebox.scss index 29eb1a03e0c..a5716c7e662 100644 --- a/app/assets/stylesheets/common/base/onebox.scss +++ b/app/assets/stylesheets/common/base/onebox.scss @@ -87,7 +87,7 @@ a.loading-onebox { @mixin onebox-favicon($class, $image) { &.#{$class} .source { - background: image-url("favicons/#{$image}.png") no-repeat 0% 50%; + background: absolute-image-url("/favicons/#{$image}.png") no-repeat 0% 50%; background-size: 16px 16px; padding-left: 20px; } @@ -289,7 +289,9 @@ aside.onebox { @mixin gdocs-logo($type) { &.g-#{$type}-logo { - background: image-url("favicons/google_branding/logo_#{$type}_48px.png") + background: absolute-image-url( + "/favicons/google_branding/logo_#{$type}_48px.png" + ) no-repeat; } } @@ -316,7 +318,9 @@ aside.onebox { width: 128px; height: 128px; &.g-calendar-logo { - background: image-url("favicons/google_branding/logo_calendar_128px.png") + background: absolute-image-url( + "/favicons/google_branding/logo_calendar_128px.png" + ) no-repeat; } } @@ -635,7 +639,7 @@ aside.onebox.stackexchange .onebox-body { width: 60px; height: 50px; float: left; - background: image-url("favicons/pdf_64px.png") no-repeat; + background: absolute-image-url("/favicons/pdf_64px.png") no-repeat; background-size: 48px 48px; display: inline-block; } diff --git a/app/assets/stylesheets/common/foundation/mixins.scss b/app/assets/stylesheets/common/foundation/mixins.scss index d6bd2eddce7..28c6b807c49 100644 --- a/app/assets/stylesheets/common/foundation/mixins.scss +++ b/app/assets/stylesheets/common/foundation/mixins.scss @@ -194,3 +194,14 @@ $breakpoints: ( @return "dark"; } } + +@function absolute-image-url($path) { + // public_image_path is added by the stylesheet importer + // it returns a CDN or subfolder path (if applicable). + // SCSS will compile (and return the relative path) if public_image_path is missing. + @if variable-exists(public_image_path) { + @return url("#{$public_image_path}#{$path}"); + } @else { + @return url("#{$path}"); + } +} diff --git a/lib/stylesheet/functions.rb b/lib/stylesheet/functions.rb index fa1c3330d33..4abc98a51a4 100644 --- a/lib/stylesheet/functions.rb +++ b/lib/stylesheet/functions.rb @@ -3,9 +3,11 @@ module Stylesheet module ScssFunctions def asset_url(path) + Discourse.deprecate("The `asset-url` SCSS function is deprecated. Use `absolute-image-url` instead.") SassC::Script::Value::String.new("url('#{ActionController::Base.helpers.asset_url(path.value)}')") end def image_url(path) + Discourse.deprecate("The `image-url` SCSS function is deprecated. Use `absolute-image-url` instead.") SassC::Script::Value::String.new("url('#{ActionController::Base.helpers.image_url(path.value)}')") end end diff --git a/lib/stylesheet/importer.rb b/lib/stylesheet/importer.rb index 01ca4686db6..8b02e809c97 100644 --- a/lib/stylesheet/importer.rb +++ b/lib/stylesheet/importer.rb @@ -152,8 +152,13 @@ module Stylesheet contents end + def public_image_path + image_path = UrlHelper.absolute("#{Discourse.base_path}/images") + "$public_image_path: \"#{image_path}\"; " + end + def prepended_scss - "#{color_variables} @import \"common/foundation/variables\"; @import \"common/foundation/mixins\"; " + "#{color_variables} #{public_image_path} @import \"common/foundation/variables\"; @import \"common/foundation/mixins\"; " end def initialize(options) diff --git a/app/assets/images/favicons/discourse.png b/public/images/favicons/discourse.png similarity index 100% rename from app/assets/images/favicons/discourse.png rename to public/images/favicons/discourse.png diff --git a/app/assets/images/favicons/google_branding/logo_calendar_128px.png b/public/images/favicons/google_branding/logo_calendar_128px.png similarity index 100% rename from app/assets/images/favicons/google_branding/logo_calendar_128px.png rename to public/images/favicons/google_branding/logo_calendar_128px.png diff --git a/app/assets/images/favicons/google_branding/logo_calendar_48px.png b/public/images/favicons/google_branding/logo_calendar_48px.png similarity index 100% rename from app/assets/images/favicons/google_branding/logo_calendar_48px.png rename to public/images/favicons/google_branding/logo_calendar_48px.png diff --git a/app/assets/images/favicons/google_branding/logo_docs_48px.png b/public/images/favicons/google_branding/logo_docs_48px.png similarity index 100% rename from app/assets/images/favicons/google_branding/logo_docs_48px.png rename to public/images/favicons/google_branding/logo_docs_48px.png diff --git a/app/assets/images/favicons/google_branding/logo_drive_48px.png b/public/images/favicons/google_branding/logo_drive_48px.png similarity index 100% rename from app/assets/images/favicons/google_branding/logo_drive_48px.png rename to public/images/favicons/google_branding/logo_drive_48px.png diff --git a/app/assets/images/favicons/google_branding/logo_forms_48px.png b/public/images/favicons/google_branding/logo_forms_48px.png similarity index 100% rename from app/assets/images/favicons/google_branding/logo_forms_48px.png rename to public/images/favicons/google_branding/logo_forms_48px.png diff --git a/app/assets/images/favicons/google_branding/logo_sheets_48px.png b/public/images/favicons/google_branding/logo_sheets_48px.png similarity index 100% rename from app/assets/images/favicons/google_branding/logo_sheets_48px.png rename to public/images/favicons/google_branding/logo_sheets_48px.png diff --git a/app/assets/images/favicons/google_branding/logo_slides_48px.png b/public/images/favicons/google_branding/logo_slides_48px.png similarity index 100% rename from app/assets/images/favicons/google_branding/logo_slides_48px.png rename to public/images/favicons/google_branding/logo_slides_48px.png diff --git a/app/assets/images/favicons/google_play.png b/public/images/favicons/google_play.png similarity index 100% rename from app/assets/images/favicons/google_play.png rename to public/images/favicons/google_play.png diff --git a/app/assets/images/favicons/instagram.png b/public/images/favicons/instagram.png similarity index 100% rename from app/assets/images/favicons/instagram.png rename to public/images/favicons/instagram.png diff --git a/app/assets/images/favicons/pdf_48px.png b/public/images/favicons/pdf_48px.png similarity index 100% rename from app/assets/images/favicons/pdf_48px.png rename to public/images/favicons/pdf_48px.png diff --git a/app/assets/images/favicons/pdf_64px.png b/public/images/favicons/pdf_64px.png similarity index 100% rename from app/assets/images/favicons/pdf_64px.png rename to public/images/favicons/pdf_64px.png diff --git a/app/assets/images/favicons/stackexchange.png b/public/images/favicons/stackexchange.png similarity index 100% rename from app/assets/images/favicons/stackexchange.png rename to public/images/favicons/stackexchange.png diff --git a/spec/components/stylesheet/compiler_spec.rb b/spec/components/stylesheet/compiler_spec.rb index 6de836e425a..b71b2d6cce3 100644 --- a/spec/components/stylesheet/compiler_spec.rb +++ b/spec/components/stylesheet/compiler_spec.rb @@ -87,6 +87,35 @@ describe Stylesheet::Compiler do expect(css).not_to include('image-url') end + it "supports absolute-image-url" do + scss = Stylesheet::Importer.new({}).prepended_scss + scss += ".body{background-image: absolute-image-url('/favicons/github.png');}" + css, _map = Stylesheet::Compiler.compile(scss, "test.scss") + + expect(css).to include('url("http://test.localhost/images/favicons/github.png")') + expect(css).not_to include('absolute-image-url') + end + + it "supports absolute-image-url in subfolder" do + set_subfolder "/subfo" + scss = Stylesheet::Importer.new({}).prepended_scss + scss += ".body{background-image: absolute-image-url('/favicons/github.png');}" + css, _map = Stylesheet::Compiler.compile(scss, "test2.scss") + + expect(css).to include('url("http://test.localhost/subfo/images/favicons/github.png")') + expect(css).not_to include('absolute-image-url') + end + + it "supports absolute-image-url with CDNs" do + set_cdn_url "https://awesome.com" + scss = Stylesheet::Importer.new({}).prepended_scss + scss += ".body{background-image: absolute-image-url('/favicons/github.png');}" + css, _map = Stylesheet::Compiler.compile(scss, "test2.scss") + + expect(css).to include('url("https://awesome.com/images/favicons/github.png")') + expect(css).not_to include('absolute-image-url') + end + context "with a color scheme" do it "returns the default color definitions when no color scheme is specified" do css, _map = Stylesheet::Compiler.compile_asset("color_definitions") diff --git a/spec/models/post_analyzer_spec.rb b/spec/models/post_analyzer_spec.rb index dccd31597ca..f7de1074ee5 100644 --- a/spec/models/post_analyzer_spec.rb +++ b/spec/models/post_analyzer_spec.rb @@ -119,7 +119,7 @@ describe PostAnalyzer do let(:raw_post_one_image_md) { "![sherlock](http://bbc.co.uk/sherlock.jpg)" } let(:raw_post_two_images_html) { " " } let(:raw_post_with_avatars) { 'smiley wink' } - let(:raw_post_with_favicon) { '' } + let(:raw_post_with_favicon) { '' } let(:raw_post_with_thumbnail) { '' } let(:raw_post_with_two_classy_images) { " " } let(:raw_post_with_two_embedded_media) { '' } diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index 5db5dab72cf..4108857b481 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -241,7 +241,7 @@ describe Post do let(:post_one_image) { post_with_body("![sherlock](http://bbc.co.uk/sherlock.jpg)", newuser) } let(:post_two_images) { post_with_body(" ", newuser) } let(:post_with_avatars) { post_with_body('smiley wink', newuser) } - let(:post_with_favicon) { post_with_body('', newuser) } + let(:post_with_favicon) { post_with_body('', newuser) } let(:post_image_within_quote) { post_with_body('[quote][/quote]', newuser) } let(:post_image_within_code) { post_with_body('', newuser) } let(:post_image_within_pre) { post_with_body('
', newuser) }