Skip to content

A platform for community discussion. Free, open, simple.

FEATURE: adds support for mobile view on page publishing (#10662)

Joffrey JAFFEUX0a4a273cccde
diff --git a/app/assets/stylesheets/publish_desktop.scss b/app/assets/stylesheets/publish_desktop.scss
new file mode 100644
index 00000000000..d9611b081d5
--- /dev/null
+++ b/app/assets/stylesheets/publish_desktop.scss
@@ -0,0 +1 @@
+@import "publish";
diff --git a/app/assets/stylesheets/publish_desktop_rtl.scss b/app/assets/stylesheets/publish_desktop_rtl.scss
new file mode 100644
index 00000000000..b13ca0ae62d
--- /dev/null
+++ b/app/assets/stylesheets/publish_desktop_rtl.scss
@@ -0,0 +1 @@
+@import "publish_desktop";
diff --git a/app/assets/stylesheets/publish_mobile.scss b/app/assets/stylesheets/publish_mobile.scss
new file mode 100644
index 00000000000..663ab399e3f
--- /dev/null
+++ b/app/assets/stylesheets/publish_mobile.scss
@@ -0,0 +1,20 @@
+@import "publish";
+
+.published-page-header {
+ .published-page-header-wrapper {
+ width: auto;
+
+ .published-page-title {
+ font-size: $font-up-3;
+ width: 100%;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+ }
+}
+
+.published-page-content-wrapper {
+ margin: 2em auto;
+ padding: 0 10px;
+}
diff --git a/app/assets/stylesheets/publish_mobile_rtl.scss b/app/assets/stylesheets/publish_mobile_rtl.scss
new file mode 100644
index 00000000000..0b2e7dfe0bb
--- /dev/null
+++ b/app/assets/stylesheets/publish_mobile_rtl.scss
@@ -0,0 +1 @@
+@import "publish_mobile";
diff --git a/app/views/common/_discourse_publish_stylesheet.html.erb b/app/views/common/_discourse_publish_stylesheet.html.erb
index 458aaff65fc..ddd5b9e40b5 100644
--- a/app/views/common/_discourse_publish_stylesheet.html.erb
+++ b/app/views/common/_discourse_publish_stylesheet.html.erb
@@ -1,5 +1,11 @@
<%= discourse_stylesheet_link_tag 'publish', theme_ids: nil %>
+<%- if rtl? %>
+ <%= discourse_stylesheet_link_tag(mobile_view? ? :publish_mobile_rtl : :publish_mobile_rtl) %>
+<%- else %>
+ <%= discourse_stylesheet_link_tag(mobile_view? ? :publish_mobile : :publish_desktop) %>
+<%- end %>
+
<%- Discourse.find_plugin_css_assets(include_official: allow_plugins?, include_unofficial: allow_third_party_plugins?, mobile_view: mobile_view?, desktop_view: !mobile_view?, request: request).each do |file| %>
<%= discourse_stylesheet_link_tag(file) %>
<%- end %>