diff --git a/assets/css/main.scss b/assets/css/main.scss index 6fbb901c28fd2c..16de2ad0dd33af 100644 --- a/assets/css/main.scss +++ b/assets/css/main.scss @@ -254,13 +254,13 @@ body { table thead th { border-bottom: 2px solid #777; - text-align: left; + text-align: inline-start; } table td:first-child, table th:first-child { border-inline-end: 2px solid #777; font-weight: bold; - text-align: left; + text-align: inline-start; } table td:not(first-child), table th:not(first-child) { @@ -1263,6 +1263,7 @@ table.contributions{ div.highlight { position: relative; } +/* Code copy button */ div.highlight .btn{ -webkit-transition:opacity .3s ease-in-out; -o-transition:opacity .3s ease-in-out; @@ -1270,7 +1271,7 @@ div.highlight .btn{ opacity:0; padding:2px 6px; position:absolute; - right:4px; + inset-inline-end:4px; top:4px; } @@ -1476,7 +1477,7 @@ div.contributors-line { } dt { width: 8em; - text-align: right; + text-align: end; font-weight: initial; } dd { @@ -1786,7 +1787,7 @@ figure > a[target="_blank"]::after { } figcaption { - text-align: left; + text-align: start; } } @@ -1929,7 +1930,7 @@ body[data-brightness="dark"] { width: 25%; } table tr td:nth-child(2) { - text-align: left; + text-align: start; display: table-cell; width: 100%; } diff --git a/bin/lint.rb b/bin/lint.rb index 2562b12f6cfef0..9a32642a949ebb 100755 --- a/bin/lint.rb +++ b/bin/lint.rb @@ -916,7 +916,55 @@ def self.fix_ga_wf(contents) def self.fix_css(contents) results = [] - results += find_matching_texts(contents, /-(left|right)/) + results += find_matching_texts(contents, /margin-left/) + .map do |idx, _text, selected| + ReviewDogEmitter.warning( + path: @path, + idx: idx, + match_start: selected.begin(1), + match_end: selected.end(1) + 1, + replacement: 'margin-inline-start', + message: 'Use margin-inline-start to support right-to-left languages See: https://firefox-source-docs.mozilla.org/code-quality/coding-style/rtl_guidelines.html', + code: 'GTN:037' + ) + end + results += find_matching_texts(contents, /margin-right/) + .map do |idx, _text, selected| + ReviewDogEmitter.warning( + path: @path, + idx: idx, + match_start: selected.begin(1), + match_end: selected.end(1) + 1, + replacement: 'margin-inline-end', + message: 'Use margin-inline-end to support right-to-left languages See: https://firefox-source-docs.mozilla.org/code-quality/coding-style/rtl_guidelines.html', + code: 'GTN:037' + ) + end + results += find_matching_texts(contents, /padding-left/) + .map do |idx, _text, selected| + ReviewDogEmitter.warning( + path: @path, + idx: idx, + match_start: selected.begin(1), + match_end: selected.end(1) + 1, + replacement: 'padding-inline-start', + message: 'Use padding-inline-start to support right-to-left languages See: https://firefox-source-docs.mozilla.org/code-quality/coding-style/rtl_guidelines.html', + code: 'GTN:037' + ) + end + results += find_matching_texts(contents, /padding-right/) + .map do |idx, _text, selected| + ReviewDogEmitter.warning( + path: @path, + idx: idx, + match_start: selected.begin(1), + match_end: selected.end(1) + 1, + replacement: 'padding-inline-end', + message: 'Use padding-inline-end to support right-to-left languages See: https://firefox-source-docs.mozilla.org/code-quality/coding-style/rtl_guidelines.html', + code: 'GTN:037' + ) + end + results += find_matching_texts(contents, /(left|[^b]right)/) .map do |idx, _text, selected| ReviewDogEmitter.warning( path: @path, @@ -924,10 +972,11 @@ def self.fix_css(contents) match_start: selected.begin(1), match_end: selected.end(1) + 1, replacement: '', - message: 'Use -start and -end instead of -left and -right to support right-to-left languages See: https://firefox-source-docs.mozilla.org/code-quality/coding-style/rtl_guidelines.html', + message: 'Use start/end to support right-to-left languages See: https://firefox-source-docs.mozilla.org/code-quality/coding-style/rtl_guidelines.html', code: 'GTN:037' ) end + results end