$(eval KSS_RL_TMP := $(shell mktemp /tmp/tmp.XXXXXXXXXX))
# Keep module names in strict alphabetical order, so CSS loads in the same order as ResourceLoader's addModuleStyles does; this can affect rendering.
# See OutputPage::makeResourceLoaderLink.
- @curl -sG "${MEDIAWIKI_LOAD_URL}?modules=mediawiki.legacy.commonPrint|mediawiki.legacy.shared|mediawiki.ui|mediawiki.ui.anchor|mediawiki.ui.button|mediawiki.ui.checkbox|mediawiki.ui.icon|mediawiki.ui.input&only=styles" > $(KSS_RL_TMP)
+ @curl -sG "${MEDIAWIKI_LOAD_URL}?modules=mediawiki.legacy.commonPrint|mediawiki.legacy.shared|mediawiki.ui|mediawiki.ui.anchor|mediawiki.ui.button|mediawiki.ui.checkbox|mediawiki.ui.icon|mediawiki.ui.input|mediawiki.ui.text&only=styles" > $(KSS_RL_TMP)
@node_modules/.bin/kss-node ../../resources/src/mediawiki.ui static/ --css $(KSS_RL_TMP) -t styleguide-template
@rm $(KSS_RL_TMP)
'position' => 'top',
'targets' => array( 'desktop', 'mobile' ),
),
+ // Lightweight module for text styles
+ 'mediawiki.ui.text' => array(
+ 'skinStyles' => array(
+ 'default' => array(
+ 'resources/src/mediawiki.ui/components/text.less',
+ ),
+ ),
+ 'position' => 'top',
+ 'targets' => array( 'desktop', 'mobile' ),
+ ),
/* es5-shim */
'es5-shim' => array(
@import "mediawiki.ui/mixins";
// Helpers
-.mw-ui-anchor( @mainColor ) {
- // Make all context classes take the main color in IE6
- .select-ie6-only& {
- &:link, &:visited, &:hover, &:focus, &:active {
- color: @mainColor;
- }
- }
+.mixin-mw-ui-anchor-styles( @mainColor ) {
+ color: @mainColor;
// Hover state
&:hover {
outline: none; // outline fix
}
- color: @mainColor;
-
// Quiet mode is gray at first
&.mw-ui-quiet {
- .mw-ui-anchor-quiet( @mainColor );
+ .mixin-mw-ui-anchor-styles-quiet( @mainColor );
}
}
-.mw-ui-anchor-quiet( @mainColor ) {
+.mixin-mw-ui-anchor-styles-quiet( @mainColor ) {
color: @colorTextLight;
text-decoration: none;
}
/*
-Text & Anchors
-
-Allows you to give text a context as to the type of action it is indicating.
-
-Styleguide 6.
-*/
-
-/*
-Guidelines
+Anchors
-This context should only applied on elements without special behavior (DIV, SPAN, etc.), including A elements. These classes cannot be applied for styling purposes on other elements (such as form elements), except when used in combination with .mw-ui-button to alter a button context.
+The anchor base type can be applied to A elements when a basic context styling needs to be given to a link, without
+having to assign it as a button type. mw-ui-anchor only changes the text color, and should not be used in combination
+with other base classes, such as mw-ui-button.
Markup:
-<a href=# class="mw-ui-progressive {$modifiers}">Progressive</a>
-<a href=# class="mw-ui-constructive {$modifiers}">Constructive</a>
-<a href=# class="mw-ui-destructive {$modifiers}">Destructive</a>
+<a href=# class="mw-ui-anchor mw-ui-progressive {$modifiers}">Progressive</a>
+<a href=# class="mw-ui-anchor mw-ui-constructive {$modifiers}">Constructive</a>
+<a href=# class="mw-ui-anchor mw-ui-destructive {$modifiers}">Destructive</a>
.mw-ui-quiet - Quiet until interaction.
-Styleguide 6.1.
+Styleguide 6.2.
*/
-.mw-ui-progressive {
- .mw-ui-anchor( @colorProgressive );
-}
-.mw-ui-constructive {
- .mw-ui-anchor( @colorConstructive );
-}
-.mw-ui-destructive {
- .mw-ui-anchor( @colorDestructive );
-}
-.mw-ui-quiet {
- .mw-ui-anchor-quiet( @colorTextLight );
+
+// Setup compound anchor selectors (such as .mw-ui-anchor.my-ui-progressive)
+.mw-ui-anchor {
+ &.mw-ui-progressive {
+ .mixin-mw-ui-anchor-styles( @colorProgressive );
+ }
+
+ &.mw-ui-constructive {
+ .mixin-mw-ui-anchor-styles( @colorConstructive );
+ }
+
+ &.mw-ui-destructive {
+ .mixin-mw-ui-anchor-styles( @colorDestructive );
+ }
}
--- /dev/null
+@import "mediawiki.mixins";
+@import "mediawiki.ui/variables";
+@import "mediawiki.ui/mixins";
+
+/*
+Text & Anchors
+
+Allows you to give text a context as to the type of action it is indicating.
+
+Styleguide 6.
+*/
+
+/*
+Text
+
+Context classes may be used on elements with only plain-text content with the mw-ui-text base. When the context classes
+are used on interactive and block-level elements, the appropriate alternative base type classes should also be used. For
+example, mw-ui-anchor with A, or mw-ui-button with buttons.
+
+Markup:
+<span class="mw-ui-text mw-ui-progressive">Progressive</span>
+<span class="mw-ui-text mw-ui-constructive">Constructive</span>
+<span class="mw-ui-text mw-ui-destructive">Destructive</span>
+
+Styleguide 6.1.
+*/
+
+.mw-ui-text {
+ // The selector order is like this on purpose; IE6 ignores the second selector,
+ // so we don't want to accidentally apply this color on all mw-ui-CONTEXT classes
+ .mw-ui-progressive& {
+ color: @colorProgressive;
+ }
+ .mw-ui-constructive& {
+ color: @colorConstructive;
+ }
+ .mw-ui-destructive& {
+ color: @colorDestructive;
+ }
+}
\ No newline at end of file