diff --git a/app/assets/images/fullscreen-off.svg b/app/assets/images/fullscreen-off.svg index 3c5d4c991..572dbd127 100644 --- a/app/assets/images/fullscreen-off.svg +++ b/app/assets/images/fullscreen-off.svg @@ -1,3 +1,3 @@ - - + + diff --git a/app/assets/images/fullscreen-on.svg b/app/assets/images/fullscreen-on.svg index cabf922fa..da7f6ad30 100644 --- a/app/assets/images/fullscreen-on.svg +++ b/app/assets/images/fullscreen-on.svg @@ -1,3 +1,3 @@ - - + + diff --git a/app/assets/stylesheets/components/syntax.scss b/app/assets/stylesheets/components/syntax.scss index 9a5f77305..1f6efdedb 100644 --- a/app/assets/stylesheets/components/syntax.scss +++ b/app/assets/stylesheets/components/syntax.scss @@ -77,9 +77,10 @@ div.highlight { .highlight-action { display: none; - width: var(--su-4); - height: var(--su-4); cursor: pointer; + color: var(--base-inverted); + width: var(--su-5); + height: var(--su-5); } .highlight-action--fullscreen-on { diff --git a/app/services/html/parser.rb b/app/services/html/parser.rb index 02de9ea4e..f17340875 100644 --- a/app/services/html/parser.rb +++ b/app/services/html/parser.rb @@ -95,11 +95,15 @@ module Html def add_fullscreen_button_to_panel on_title = "Enter fullscreen mode" - on_cls = "highlight-action highlight-action--fullscreen-on" - icon_fullscreen_on = inline_svg_tag("fullscreen-on.svg", class: on_cls, title: on_title) + on_cls = "highlight-action crayons-icon highlight-action--fullscreen-on" + icon_fullscreen_on = inline_svg_tag( + "fullscreen-on.svg", class: on_cls, title: on_title, width: "20px", height: "20px" + ) off_title = "Exit fullscreen mode" - off_cls = "highlight-action highlight-action--fullscreen-off" - icon_fullscreen_off = inline_svg_tag("fullscreen-off.svg", class: off_cls, title: off_title) + off_cls = "highlight-action crayons-icon highlight-action--fullscreen-off" + icon_fullscreen_off = inline_svg_tag( + "fullscreen-off.svg", class: off_cls, title: off_title, width: "20px", height: "20px" + ) doc = Nokogiri::HTML.fragment(@html) doc.search("div.highlight__panel").each do |codeblock| fullscreen_action = <<~HTML diff --git a/lib/data_update_scripts/20210104170542_resave_articles_for_code_snippet_fullscreen_icon.rb b/lib/data_update_scripts/20210104170542_resave_articles_for_code_snippet_fullscreen_icon.rb new file mode 100644 index 000000000..3190e0a7f --- /dev/null +++ b/lib/data_update_scripts/20210104170542_resave_articles_for_code_snippet_fullscreen_icon.rb @@ -0,0 +1,9 @@ +module DataUpdateScripts + class ResaveArticlesForCodeSnippetFullscreenIcon + def run + # We need to regenerate the markdown for code snippets + # See https://github.com/forem/forem/issues/11747#issuecomment-753620156 + Article.published.find_each(&:save) + end + end +end diff --git a/spec/support/fixtures/approvals/user_preview_article_body.approved.html b/spec/support/fixtures/approvals/user_preview_article_body.approved.html index b7a605ddf..76e8d0cf2 100644 --- a/spec/support/fixtures/approvals/user_preview_article_body.approved.html +++ b/spec/support/fixtures/approvals/user_preview_article_body.approved.html @@ -108,7 +108,7 @@ the present is our past.

- Enter fullscreen modeExit fullscreen mode
+ Enter fullscreen modeExit fullscreen mode
@@ -122,7 +122,7 @@ function hello() {
- Enter fullscreen modeExit fullscreen mode
+ Enter fullscreen modeExit fullscreen mode