]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add streamlined mobile device-friendly styles when enabled in config.
authorMeitar Moscovitz <meitarm@gmail.com>
Tue, 10 Feb 2009 16:03:16 +0000 (03:03 +1100)
committerMeitar Moscovitz <meitarm@gmail.com>
Tue, 10 Feb 2009 16:03:16 +0000 (03:03 +1100)
A new mobile-specific style sheet is added and loaded only if the
`$config['site']['mobile']` configuration variable is set to true.

config.php.sample
lib/action.php
theme/base/css/mobile.css [new file with mode: 0644]

index a2c5801f45c41995eafe64f1f8a2f40900dd087e..d1191ea01b1bf75f08901520fc31fbecc9ef4e7f 100644 (file)
@@ -18,6 +18,8 @@ $config['site']['server'] = 'localhost';
 $config['site']['path'] = 'laconica';
 #$config['site']['fancy'] = false;
 #$config['site']['theme'] = 'default';
+#To enable the built-in mobile style sheet, defaults to false.
+#$config['site']['mobile'] = true;
 #For contact email, defaults to $_SERVER["SERVER_ADMIN"]
 #$config['site']['email'] = 'admin@example.net';
 #Brought by...
index ce92addf5c1305424525604726b358b6ebb11b85..ce37f4760a9a2263f730122d4ccb8513ccfb1c93 100644 (file)
@@ -170,6 +170,13 @@ class Action extends HTMLOutputter // lawsuit
         }
         $this->comment('[if IE]><link rel="stylesheet" type="text/css" '.
                        'href="'.theme_path('css/ie.css', null).'?version='.LACONICA_VERSION.'" /><![endif]');
+        if (common_config('site', 'mobile')) {
+            $this->element('link', array('rel' => 'stylesheet',
+                                         'type' => 'text/css',
+                                         'href' => theme_path('css/mobile.css', 'base') . '?version=' . LACONICA_VERSION,
+                                         // TODO: "handheld" CSS for other mobile devices
+                                         'media' => 'screen and (max-device-width: 480px)')); // Mobile WebKit
+        }
     }
 
     /**
diff --git a/theme/base/css/mobile.css b/theme/base/css/mobile.css
new file mode 100644 (file)
index 0000000..6cd717a
--- /dev/null
@@ -0,0 +1,48 @@
+/** theme: base
+ *
+ * @package   Laconica
+ * @author    Meitar Moscovitz <meitar@maymay.net>
+ * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
+ * @link      http://laconi.ca/
+ */
+
+/* Go linear. */
+#header,
+#header address,
+#site_nav_global_primary,
+#anon_notice,
+#site_nav_local_views .nav,
+#core,
+#content_inner,
+#notices_primary,
+.notice,
+.notice .entry-title,
+.notice div.entry-content,
+.pagination,
+.pagination .nav,
+.aside .section { float: none; }
+
+/* And liquid. */
+#wrap { width: 95%; }
+
+body { font-size: 2em; } /* Make things bigger on smaller screens. */
+
+#site_nav_global_primary, #site_nav_global_secondary { text-align: center; }
+
+.notice div.entry-content { margin-left: 0; }
+address { margin: 0; }
+
+#anon_notice, #footer { clear: left; width: auto; font-size: .5em; }
+
+#content { padding: 18px 0; width: 100%; }
+#content h1, #page_notice, #content_inner { padding: 0 18px; }
+#content_inner { width: auto; }
+.pagination .nav { overflow: auto; }
+
+#aside_primary { margin: 10px 0 0 0; border: none; padding: 0; width: 100%; }
+#popular_notices { float: none; width: auto; }
+/* Columns for supplemental info. */
+.aside .section { clear: none; padding: 9px; width: 45%; }
+#top_groups_by_post { float: left; }
+#featured_users { float: right; }
+#export_data { display: none; }