From ba6ce4f7aa436d15d3d0fc80d581b8ffee750726 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Sun, 6 Oct 2024 23:25:39 +0330 Subject: [PATCH] Simplify direction specific styles using margin-inline Bug: T371265 Change-Id: I25046b9982954f47a417a40f8a39c8a4e2f4c6a8 --- modules/dt.init.less | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/modules/dt.init.less b/modules/dt.init.less index 2d31af752..c36e1b7f1 100644 --- a/modules/dt.init.less +++ b/modules/dt.init.less @@ -1,4 +1,5 @@ @import 'mediawiki.skin.variables.less'; +@import 'mediawiki.mixins.less'; /* stylelint-disable no-descending-specificity */ span[ data-mw-comment-start ] { @@ -59,20 +60,12 @@ h1, h2, h3, h4, h5, h6 { &-bracket { color: @color-subtle; - .mw-content-ltr &:not( :last-child ), - .mw-content-rtl .mw-content-ltr &:not( :last-child ), - .mw-content-rtl &:last-child, - .mw-content-ltr .mw-content-rtl &:last-child { - /* @noflip */ - margin-right: 0.25em; + &:not( :last-child ) { + .margin-inline( 0, 0.25em ); } - .mw-content-ltr &:last-child, - .mw-content-rtl .mw-content-ltr &:last-child, - .mw-content-rtl &:not( :last-child ), - .mw-content-ltr .mw-content-rtl &:not( :last-child ), { - /* @noflip */ - margin-left: 0.25em; + &:last-child { + .margin-inline( 0.25em, 0 ); } } } @@ -236,20 +229,12 @@ h1, h2, h3, h4, h5, h6 { &-bracket { color: @color-subtle; - .mw-content-ltr &:first-child, - .mw-content-rtl .mw-content-ltr &:first-child, - .mw-content-rtl &:last-child, - .mw-content-ltr .mw-content-rtl &:last-child { - /* @noflip */ - margin-right: 0.25em; + &:first-child { + .margin-inline( 0, 0.25em ); } - .mw-content-ltr &:last-child, - .mw-content-rtl .mw-content-ltr &:last-child, - .mw-content-rtl &:first-child, - .mw-content-ltr .mw-content-rtl &:first-child { - /* @noflip */ - margin-left: 0.25em; + &:last-child { + .margin-inline( 0.25em, 0 ); } }