mediawiki.mixins: Add `hyphens` mixin
authorVolker E <volker.e@wikimedia.org>
Thu, 22 Feb 2018 20:05:58 +0000 (12:05 -0800)
committerVolker E <volker.e@wikimedia.org>
Thu, 22 Feb 2018 20:05:58 +0000 (12:05 -0800)
As `hyphens` values are used in various places now, with most
recent addition I1637ce3f5bddb we should add it in a central place.

Change-Id: I660f3ecd2a4669e8d5c8415990fa2e8a25aea32a

resources/src/mediawiki.less/mediawiki.mixins.less

index 58f6dc2..986d29f 100644 (file)
        list-style-image: e( '/* @embed */' ) url( @fallback ) e( '\9' );
 }
 
+.hyphens( @value: auto ) {
+       & when ( @value = auto ){
+               // Legacy `word-wrap`; IE 6-11, Edge 12+, Firefox 3.5+, Chrome 4+, Safari 3.1+,
+               //   Opera 11.5+, iOS 3.2+, Android 2.1+
+               // `overflow-wrap` is W3 standard, but it doesn't seem as if browser vendors
+               //   will abandon `word-wrap` (it has wider support), therefore no duplication.
+               word-wrap: break-word;
+       }
+
+       // CSS3 hyphenation
+       -webkit-hyphens: @value; // Safari 5.1+, iOS 4.3+
+       -moz-hyphens: @value;    // Firefox 6-42
+       -ms-hyphens: @value;     // IE 10-11/Edge 12+
+       hyphens: @value;         // Firefox 43+, Chrome 55+, Android 62+, UC Browser 11.8+, Samsung 6.2+
+}
+
 .transform( @value ) {
        -webkit-transform: @value; // Safari 3.1-8.0, iOS 3.2-8.4, Android 2.1-4.4.4
        -moz-transform: @value; // Firefox 3.5-15