Foxtrott has submitted this change and it was merged.

Change subject: Load MW's shared.css; add styling for img, links, lists
......................................................................


Load MW's shared.css; add styling for img, links, lists

MW's shared.css contains styling for the wikitable class

Bug: 70808
Change-Id: I1f7b6055861ffc59b0f463801d455bd13b057642
---
M Chameleon.php
M src/Hooks/SetupAfterCache.php
M styles/core.less
M styles/images.less
A styles/mixins.less
M styles/screen.less
M styles/thumbnails.less
M styles/variables.less
M tests/phpunit/Hooks/SetupAfterCacheTest.php
9 files changed, 313 insertions(+), 30 deletions(-)

Approvals:
  Foxtrott: Verified; Looks good to me, approved



diff --git a/Chameleon.php b/Chameleon.php
index fc08043..96c92c6 100644
--- a/Chameleon.php
+++ b/Chameleon.php
@@ -116,6 +116,7 @@
                        'egChameleonExternalStyleModules',
                        'egChameleonExternalLessVariables',
                        'egChameleonEnableVisualEditor',
+                       'IP',
                        'wgStyleDirectory',
                        'wgStylePath',
                        'wgVisualEditorSupportedSkins',
diff --git a/src/Hooks/SetupAfterCache.php b/src/Hooks/SetupAfterCache.php
index af5084b..3512a89 100644
--- a/src/Hooks/SetupAfterCache.php
+++ b/src/Hooks/SetupAfterCache.php
@@ -85,6 +85,17 @@
                // $this->isReadableFile( 
$this->configuration['wgStyleDirectory'] . '/chameleon/styles/' . 'screen.less' 
)
 
                $this->bootstrapManager->addAllBootstrapModules();
+
+               if ( file_exists( $this->configuration['wgStyleDirectory'] . 
'/common/shared.css' ) ) { // MW < 1.24
+                       $this->bootstrapManager->addExternalModule(
+                               $this->configuration['wgStyleDirectory'] . 
'/common/shared.css'
+                       );
+               } else if ( file_exists( $this->configuration['IP'] . 
'/resources/src/mediawiki.legacy/shared.css') ) { // MW >= 1.24
+                       $this->bootstrapManager->addExternalModule(
+                               $this->configuration['IP'] . 
'/resources/src/mediawiki.legacy/shared.css'
+                       );
+               }
+
                $this->bootstrapManager->addExternalModule(
                        $this->configuration['wgStyleDirectory'] . 
'/chameleon/styles/' . 'core.less',
                        $this->configuration['wgStylePath'] . 
'/chameleon/styles/'
diff --git a/styles/core.less b/styles/core.less
index a481a4e..98b3566 100644
--- a/styles/core.less
+++ b/styles/core.less
@@ -20,6 +20,7 @@
  */
 
 @import "./variables.less";
+@import "./mixins.less";
 @import "./utils.less";
 @import "./images.less";
 @import "./thumbnails.less";
diff --git a/styles/images.less b/styles/images.less
index c6828c6..7e1258e 100644
--- a/styles/images.less
+++ b/styles/images.less
@@ -20,6 +20,13 @@
  */
 
 
-img.thumbborder {
-       border: 1px solid @thumbnail-border;
+/* Inline Elements */
+img {
+       border: none;
+       vertical-align: middle;
+
+       .thumbborder {
+               border: 1px solid @thumbnail-border;
+       }
 }
+
diff --git a/styles/mixins.less b/styles/mixins.less
new file mode 100644
index 0000000..8031fde
--- /dev/null
+++ b/styles/mixins.less
@@ -0,0 +1,50 @@
+/**
+ * Mixins used for the Chameleon skin styles
+ *
+ * @copyright (C) 2014, Stephan Gambke
+ * @license       http://www.gnu.org/licenses/gpl-3.0.html GNU General Public 
License, version 3 (or later)
+ *
+ * This file is part of the MediaWiki extension Chameleon.
+ * The Chameleon extension is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * The Chameleon extension is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * Colors for links
+ *
+ * :hover MUST come after :link and :visited
+ * :active MUST come after :hover
+ */
+.link( @color ) {
+       &:link {
+               color: @color;
+       }
+       &:visited {
+               color: darken(@color, 20%);
+       }
+       &:focus {
+               color: darken(@color, 15%);
+       }
+       &:hover {
+               color: darken(@color, 15%);
+       }
+       &:active {
+               color: difference(@color, #ffffff);
+       }
+       &:visited:focus {
+               color: darken(@color, 30%);
+       }
+       &:visited:hover {
+               color: darken(@color, 30%);
+       }
+}
diff --git a/styles/screen.less b/styles/screen.less
index df6823b..ee4ac5a 100644
--- a/styles/screen.less
+++ b/styles/screen.less
@@ -104,19 +104,11 @@
                        border-bottom: 1px solid @navbar-default-border;
 
                        &.navbar-newtalk-available {
-                               color: @navbar-newtalk-available;
-
-                               &:hover {
-                                       color: @navbar-newtalk-available-hover;
-                               }
+                               .link( @navbar-newtalk-available );
                        }
 
                        &.navbar-userloggedin {
-                               color: @navbar-user-loggedin;
-
-                               &:hover {
-                                       color: @navbar-user-loggedin-hover;
-                               }
+                               .link( @navbar-user-loggedin );
                        }
 
                }
@@ -128,11 +120,7 @@
                                border-bottom: 1px solid @navbar-default-border;
 
                                &.navbar-userloggedin {
-                                       color: @navbar-user-loggedin;
-
-                                       &:hover {
-                                               color: 
@navbar-user-loggedin-hover;
-                                       }
+                                       .link( @navbar-user-loggedin );
                                }
 
                        }
@@ -152,13 +140,17 @@
        overflow: hidden;
 }
 
-.toc {
+/**
+* Table of contents
+*/
+.mw-body .toc {
        #toctitle {
                margin-bottom: 1ex;
 
                h2 {
                        display: inline;
                        font-size: @toctitle-font-size;
+                       border: none;
                }
 
                .toctoggle {
@@ -172,10 +164,15 @@
                margin-left: 0.5em;
                padding: 0;
                text-align: left;
+               text-indent: 0;
                display: table;
 
                li {
                        display: table-row-group;
+
+                       &:before{
+                               content: none;
+                       }
 
                        a {
                                display: table-row;
@@ -192,6 +189,11 @@
                }
 
        }
+}
+
+/* have to insert id based rule here to over-rule MW core's shared.css */
+#toc ul {
+       margin-left: 0.5em;
 }
 
 .mw-body {
@@ -244,9 +246,9 @@
        }
 }
 
-.p-personal a.new {
-       color: #aaaaaa;
-}
+//.p-personal a.new {
+//     color: #aaaaaa;
+//}
 
 .p-personal-tools {
        margin: 0 0 0 1ex;
@@ -289,3 +291,200 @@
        display: block;
 }
 
+
+/**
+ * Links
+ */
+a {
+       .link(@link-color);
+}
+
+a.new, #p-personal a.new {
+       .link(@link-new-color);
+}
+
+.mw-body {
+       a.stub {
+               .link(@link-stub-color);
+       }
+
+       /* Interwiki Styling */
+       a.extiw {
+               .link(@link-interwiki-color);
+       }
+
+       /* External links */
+       a.external {
+               .link(@link-external-color);
+       }
+}
+
+/**
+* Lists
+*/
+.mw-body {
+       ul {
+               list-style: none;
+               padding-left: 3ex;
+               text-indent: -2.5ex;
+               margin: 0;
+               > li:before {
+                       color: @list-bullet-color;
+                       padding-right: 0.2ex;
+
+               }
+       }
+
+       ol {
+               text-indent: 0ex;
+       }
+
+       ul > li:before {
+               content: @ul-level1-bullet;
+       }
+
+
+       ul, ol {
+               ul > li:before {
+                       content: @ul-level2-bullet;
+               }
+       }
+
+       ul, ol {
+               ul, ol {
+                       ul > li:before {
+                               content: @ul-level3-bullet;
+                       }
+               }
+       }
+
+       .ns-special & { // reset styles for special pages
+               ul {
+                       padding-left: inherit;
+                       text-indent: inherit;
+                       margin: 2ex 0;
+
+                       li:before {
+                               content: none;
+                       }
+               }
+
+               li {
+                       margin: .5ex 0;
+               }
+       }
+}
+
+
+//p {
+//     margin: .4em 0 .5em 0;
+//     line-height: 1.5em;
+//}
+//
+//p img {
+//     margin: 0;
+//}
+
+
+dt {
+       font-weight: bold;
+       margin-bottom: .1em;
+}
+
+dl {
+       margin-top: .2em;
+       margin-bottom: .5em;
+}
+
+dd {
+       line-height: 1.5em;
+       margin-left: 1.6em;
+       margin-bottom: .1em;
+}
+
+/* IE 6 and 7 lack support for quotes aroud the <q> element ('::before' and 
'::after'
+   pseudoelements, 'quotes' property). Let's italicize it instead (using the 
star hack). */
+q {
+       *font-style: italic;
+}
+
+pre, code, tt, kbd, samp, .mw-code {
+       /*
+        * Some browsers will render the monospace text too small, namely 
Firefox, Chrome and Safari.
+        * Specifying any valid, second value will trigger correct behavior 
without forcing a different font.
+        */
+       font-family: monospace, Courier;
+}
+
+code {
+       color: black;
+       background-color: #f9f9f9;
+       border: 1px solid #ddd;
+       border-radius: 2px;
+       padding: 1px 4px;
+}
+
+pre, .mw-code {
+       color: black;
+       background-color: #f9f9f9;
+       border: 1px solid #ddd;
+       padding: 1em;
+}
+
+/* Tables */
+table {
+       font-size: 100%;
+}
+
+/* Forms */
+fieldset {
+       border: 1px solid #2f6fab;
+       margin: 1em 0 1em 0;
+       padding: 0 1em 1em;
+       line-height: 1.5em;
+}
+
+fieldset.nested {
+       margin: 0 0 0.5em 0;
+       padding: 0 0.5em 0.5em;
+}
+
+legend {
+       padding: .5em;
+       font-size: 95%;
+}
+
+form {
+       border: none;
+       margin: 0;
+}
+
+textarea {
+       width: 100%;
+       padding: .1em;
+       display: block;
+}
+
+select {
+       vertical-align: top;
+}
+
+
+/* Small for tables and similar */
+.small {
+       font-size: 94%;
+}
+
+table.small {
+       font-size: 100%;
+}
+
+.mw-warning {
+       border: 1px solid #aaa;
+       background-color: #f9f9f9;
+       padding: 5px;
+       font-size: 95%;
+       margin-left: 50px;
+       margin-right: 50px;
+       text-align: center;
+}
diff --git a/styles/thumbnails.less b/styles/thumbnails.less
index 00fa929..8592d1e 100644
--- a/styles/thumbnails.less
+++ b/styles/thumbnails.less
@@ -46,7 +46,7 @@
 
                &:hover {
                        text-decoration: none;
-                       color: @text-color;
+                       color: @thumbnail-caption-color;
                }
 
                * {
diff --git a/styles/variables.less b/styles/variables.less
index 061bc3c..cdb16b8 100644
--- a/styles/variables.less
+++ b/styles/variables.less
@@ -19,6 +19,19 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+// Global textual link colors.
+@link-color: @brand-primary;
+@link-new-color: #b52b27;
+
+@link-stub-color: @link-color;
+@link-interwiki-color: @link-color;
+@link-external-color: @link-color;
+
+@ul-level1-bullet: "\26ab"; // bullet
+@ul-level2-bullet: "\2022"; // bullet
+@ul-level3-bullet: "\2219"; // bullet
+@list-bullet-color: @gray-light;
+
 @thumbnail-caption-padding: 3px;
 
 @toctitle-font-size: @font-size-large;
@@ -27,7 +40,4 @@
 @navbar-logo-height: .9 * @navbar-height;
 
 @navbar-user-loggedin : @brand-primary;
-@navbar-user-loggedin-hover: darken(@navbar-newtalk-available, 20%);
-
 @navbar-newtalk-available: @brand-primary;
-@navbar-newtalk-available-hover: darken(@navbar-newtalk-available, 20%);
diff --git a/tests/phpunit/Hooks/SetupAfterCacheTest.php 
b/tests/phpunit/Hooks/SetupAfterCacheTest.php
index f007660..5c06af0 100644
--- a/tests/phpunit/Hooks/SetupAfterCacheTest.php
+++ b/tests/phpunit/Hooks/SetupAfterCacheTest.php
@@ -80,7 +80,8 @@
 
                $configuration = array(
                        'egChameleonExternalStyleModules' => 
$mixedExternalStyleModules,
-                       'wgStyleDirectory'                => 
'notTestinwgStyleDirectory',
+                       'IP'                              => 'notTestingIP',
+                       'wgStyleDirectory'                => 
'notTestingwgStyleDirectory',
                        'wgStylePath'                     => 
'notTestingwgStylePath'
                );
 
@@ -112,7 +113,8 @@
 
                $configuration = array(
                        'egChameleonExternalStyleModules' => 
$externalStyleModules,
-                       'wgStyleDirectory'                => 
'notTestinwgStyleDirectory',
+                       'IP'                              => 'notTestingIP',
+                       'wgStyleDirectory'                => 
'notTestingwgStyleDirectory',
                        'wgStylePath'                     => 
'notTestingwgStylePath'
                );
 
@@ -152,7 +154,8 @@
 
                $configuration = array(
                        'egChameleonExternalLessVariables' => 
$externalLessVariables,
-                       'wgStyleDirectory'                => 
'notTestinwgStyleDirectory',
+                       'IP'                              => 'notTestingIP',
+                       'wgStyleDirectory'                => 
'notTestingwgStyleDirectory',
                        'wgStylePath'                     => 
'notTestingwgStylePath'
                );
 
@@ -200,8 +203,9 @@
                        ->getMock();
 
                $defaultConfiguration = array(
-                       'wgStyleDirectory' => 'notTestingwgStyleDirectory',
-                       'wgStylePath' => 'notTestingwgStylePath'
+                       'IP'                              => 'notTestingIP',
+                       'wgStyleDirectory'                => 
'notTestingwgStyleDirectory',
+                       'wgStylePath'                     => 
'notTestingwgStylePath'
                );
 
                $configurationToBeAdjusted = array();

-- 
To view, visit https://gerrit.wikimedia.org/r/160255
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1f7b6055861ffc59b0f463801d455bd13b057642
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/skins/chameleon
Gerrit-Branch: master
Gerrit-Owner: Foxtrott <s7ep...@gmail.com>
Gerrit-Reviewer: Foxtrott <s7ep...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to