From 4e912d2ed869809066c98cf4ba3675de8086c29d Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 23 Feb 2020 17:48:27 +0100 Subject: [PATCH] Disallow leading zeroes in Less (#10407) --- .stylelintrc | 1 + web_src/less/_admin.less | 2 +- web_src/less/_base.less | 52 +++++++++---------- web_src/less/_dashboard.less | 4 +- web_src/less/_form.less | 6 +-- web_src/less/_markdown.less | 10 ++-- web_src/less/_repository.less | 64 ++++++++++++------------ web_src/less/_review.less | 12 ++--- web_src/less/_tribute.less | 2 +- web_src/less/_user.less | 2 +- web_src/less/themes/theme-arc-green.less | 48 +++++++++--------- 11 files changed, 102 insertions(+), 101 deletions(-) diff --git a/.stylelintrc b/.stylelintrc index 669d2d7b7..be1c15bfa 100644 --- a/.stylelintrc +++ b/.stylelintrc @@ -11,5 +11,6 @@ rules: declaration-empty-line-before: null indentation: 4 no-descending-specificity: null + number-leading-zero: never rule-empty-line-before: null selector-pseudo-element-colon-notation: null diff --git a/web_src/less/_admin.less b/web_src/less/_admin.less index 0bd685142..cadb095a9 100644 --- a/web_src/less/_admin.less +++ b/web_src/less/_admin.less @@ -32,7 +32,7 @@ .ui.header, .ui.segment { - box-shadow: 0 1px 2px 0 rgba(34, 36, 38, 0.15); + box-shadow: 0 1px 2px 0 rgba(34, 36, 38, .15); } &.user { diff --git a/web_src/less/_base.less b/web_src/less/_base.less index 3e7e16c63..3b40abe20 100644 --- a/web_src/less/_base.less +++ b/web_src/less/_base.less @@ -180,7 +180,7 @@ a { } .rounded { - border-radius: 0.28571429rem !important; + border-radius: .28571429rem !important; } .wrap { @@ -232,7 +232,7 @@ code, &.light { background-color: white; border-bottom: 1px solid #dddddd; - box-shadow: 0 2px 3px rgba(0, 0, 0, 0.04); + box-shadow: 0 2px 3px rgba(0, 0, 0, .04); } .column .menu { @@ -254,7 +254,7 @@ code, } .top.menu a.item:hover { - color: rgba(0, 0, 0, 0.45); + color: rgba(0, 0, 0, .45); } .top.menu .menu { @@ -266,7 +266,7 @@ code, } .svg { - margin-right: 0.75em; + margin-right: .75em; } .searchbox { @@ -285,7 +285,7 @@ code, #navbar { width: 100vw; min-height: 52px; - padding: 0 0.5rem; + padding: 0 .5rem; } #navbar .brand { @@ -359,11 +359,11 @@ code, /* This fixes the commit graph button on the commits page */ .menu:not(.vertical) .item > .button.compact { - padding: 0.58928571em 1.125em; + padding: .58928571em 1.125em; } .menu:not(.vertical) .item > .button.small { - font-size: 0.92857143rem; + font-size: .92857143rem; } &.menu .ui.dropdown.item .menu .item { @@ -379,7 +379,7 @@ code, } &.dropdown .menu > .header { - font-size: 0.8em; + font-size: .8em; } .text { @@ -456,7 +456,7 @@ code, } &.small { - font-size: 0.75em; + font-size: .75em; } &.normal { @@ -522,7 +522,7 @@ code, } .header > i + .content { - padding-left: 0.75rem; + padding-left: .75rem; vertical-align: middle; } @@ -647,7 +647,7 @@ code, .migrate { color: #888888 !important; - opacity: 0.5; + opacity: .5; a { color: #444444 !important; @@ -712,7 +712,7 @@ code, .file-comment { font: 12px @monospaced-fonts, monospace; - color: rgba(0, 0, 0, 0.87); + color: rgba(0, 0, 0, .87); } .ui.floating.dropdown { @@ -720,7 +720,7 @@ code, .scrolling.menu.items { border-radius: 0 !important; box-shadow: none !important; - border-bottom: 1px solid rgba(34, 36, 38, 0.15); + border-bottom: 1px solid rgba(34, 36, 38, .15); } } } @@ -745,7 +745,7 @@ footer { .container { width: 100vw !important; - padding: 0 0.5rem; + padding: 0 .5rem; max-width: calc(100vw - 1rem) !important; .fa { @@ -885,11 +885,11 @@ footer { } .ui.menu.new-menu::-webkit-scrollbar-track { - background: rgba(0, 0, 0, 0.01); + background: rgba(0, 0, 0, .01); } .ui.menu.new-menu::-webkit-scrollbar-thumb { - background: rgba(0, 0, 0, 0.2); + background: rgba(0, 0, 0, .2); } .ui.menu.new-menu:after { @@ -990,15 +990,15 @@ footer { /* Tab color tweaks */ .ui.tabular.menu .item { - color: rgba(0, 0, 0, 0.5); + color: rgba(0, 0, 0, .5); } .ui.tabular.menu .item:hover { - color: rgba(0, 0, 0, 0.8); + color: rgba(0, 0, 0, .8); } .ui.tabular.menu .item.active { - color: rgba(0, 0, 0, 0.9); + color: rgba(0, 0, 0, .9); } /* multiple radio or checkboxes as inline element */ @@ -1026,7 +1026,7 @@ i.icon.centerlock { } .ui.label > .detail .icons { - margin-right: 0.25em; + margin-right: .25em; } .ui.label > .detail .icons .icon { @@ -1152,7 +1152,7 @@ i.icon.centerlock { } .octicon-tiny { - font-size: 0.85714286rem; + font-size: .85714286rem; } .ui.basic.blue.button, @@ -1180,14 +1180,14 @@ i.icon.centerlock { } .ui.popup .ui.label { - margin-bottom: 0.4em; + margin-bottom: .4em; } .color-icon { - padding-right: 0.7em; - padding-left: 0.5em; - margin-right: 0.5em; - margin-left: 0.5em; + padding-right: .7em; + padding-left: .5em; + margin-right: .5em; + margin-left: .5em; display: inline; border: 1px solid #ccc; border-radius: 500em; diff --git a/web_src/less/_dashboard.less b/web_src/less/_dashboard.less index ab0d3b61b..9cfbb6db9 100644 --- a/web_src/less/_dashboard.less +++ b/web_src/less/_dashboard.less @@ -73,7 +73,7 @@ .dashboard-navbar { width: 100vw; - padding: 0 0.5rem; + padding: 0 .5rem; } } @@ -118,7 +118,7 @@ code { padding: 1px; font-size: 85%; - background-color: rgba(0, 0, 0, 0.04); + background-color: rgba(0, 0, 0, .04); border-radius: 3px; word-break: break-all; } diff --git a/web_src/less/_form.less b/web_src/less/_form.less index 2f37666fb..de48f0ba5 100644 --- a/web_src/less/_form.less +++ b/web_src/less/_form.less @@ -1,8 +1,8 @@ .form { .help { color: #999999; - padding-top: 0.6em; - padding-bottom: 0.6em; + padding-top: .6em; + padding-bottom: .6em; display: inline-block; } } @@ -109,7 +109,7 @@ @media screen and (max-height: 575px) { #rc-imageselect, .g-recaptcha { - transform: scale(0.77); + transform: scale(.77); transform-origin: 0 0; } } diff --git a/web_src/less/_markdown.less b/web_src/less/_markdown.less index 8c7b1125c..cb2ce32c3 100644 --- a/web_src/less/_markdown.less +++ b/web_src/less/_markdown.less @@ -107,7 +107,7 @@ } h1 { - padding-bottom: 0.3em; + padding-bottom: .3em; font-size: 2.25em; line-height: 1.2; border-bottom: 1px solid #eeeeee; @@ -118,7 +118,7 @@ } h2 { - padding-bottom: 0.3em; + padding-bottom: .3em; font-size: 1.75em; line-height: 1.225; border-bottom: 1px solid #eeeeee; @@ -366,10 +366,10 @@ code, tt { - padding: 0.2em 0; + padding: .2em 0; margin: 0; font-size: 85%; - background-color: rgba(0, 0, 0, 0.04); + background-color: rgba(0, 0, 0, .04); border-radius: 3px; } @@ -377,7 +377,7 @@ code:after, tt:before, tt:after { - letter-spacing: -0.2em; + letter-spacing: -.2em; content: "\00a0"; } diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index d0163b49e..6c715ee5e 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -170,7 +170,7 @@ } .text { - margin-left: 0.9em; + margin-left: .9em; } .menu { @@ -232,7 +232,7 @@ padding: 0 5px; &:first-child { - border-radius: 0.28571429rem 0 0 0.28571429rem; + border-radius: .28571429rem 0 0 .28571429rem; } } @@ -382,11 +382,11 @@ } .small.icon { - font-size: 0.75em; + font-size: .75em; } .tiny.icon { - font-size: 0.5em; + font-size: .5em; } .file-actions { @@ -469,7 +469,7 @@ input { vertical-align: middle; - box-shadow: rgba(0, 0, 0, 0.0745098) 0 1px 2px inset; + box-shadow: rgba(0, 0, 0, .0745098) 0 1px 2px inset; width: inherit; padding: 7px 8px; margin-right: 5px; @@ -509,8 +509,8 @@ display: inline-block; padding: 3px 6px; font: 12px @monospaced-fonts, monospace; - color: rgba(0, 0, 0, 0.65); - background-color: rgba(209, 227, 237, 0.45); + color: rgba(0, 0, 0, .65); + background-color: rgba(209, 227, 237, .45); border-radius: 3px; } @@ -601,7 +601,7 @@ margin-bottom: 5px; .ui.input { - font-size: 0.5em; + font-size: .5em; vertical-align: top; width: 50%; min-width: 600px; @@ -660,7 +660,7 @@ } .branch-update.grid { margin-bottom: -1.5rem; - margin-top: -0.5rem; + margin-top: -.5rem; .row { padding-bottom: 0; } @@ -679,12 +679,12 @@ .svg { width: 23px; height: 23px; - margin-top: 0.45em; + margin-top: .45em; } } .text { - margin: 0.3em 0 0.5em 0.5em; + margin: .3em 0 .5em .5em; } .type-icon { @@ -693,7 +693,7 @@ } .divider { - margin: 0.5rem 0; + margin: .5rem 0; } .review-content { @@ -748,7 +748,7 @@ margin-top: 3px; padding: 2px 5px; font-size: 12px; - border: 1px solid rgba(0, 0, 0, 0.1); + border: 1px solid rgba(0, 0, 0, .1); border-radius: 3px; &.review { margin-left: 5px; @@ -977,7 +977,7 @@ } .detail { - font-size: 0.9rem; + font-size: .9rem; margin-top: 5px; margin-left: 35px; @@ -1247,7 +1247,7 @@ } &.ui.basic.striped.table tbody tr:nth-child(2n) { - background-color: rgba(0, 0, 0, 0.02) !important; + background-color: rgba(0, 0, 0, .02) !important; } } @@ -1565,7 +1565,7 @@ } .clone.button:first-child { - border-radius: 0.28571429rem 0 0 0.28571429rem; + border-radius: .28571429rem 0 0 .28571429rem; } .ui.action.small.input { @@ -1933,7 +1933,7 @@ } &.active { - background: rgba(0, 0, 0, 0.05); + background: rgba(0, 0, 0, .05); } } } @@ -1946,12 +1946,12 @@ left: auto !important; > .header { - margin: 0.75rem 0 0.5rem; + margin: .75rem 0 .5rem; } > .item { float: left; - padding: 0.5rem 0.5rem !important; + padding: .5rem .5rem !important; img.emoji { margin-right: 0; @@ -1965,7 +1965,7 @@ display: flex; .ui.label { - padding: 0.4em; + padding: .4em; padding-right: 1em; padding-left: 1em; border: 0; @@ -1977,7 +1977,7 @@ &.disabled { cursor: default; - opacity: 0.5; + opacity: .5; } > img { @@ -1992,7 +1992,7 @@ .select-reaction { float: left; - padding: 0.5em; + padding: .5em; padding-left: 1em; &:not(.active) a { @@ -2013,7 +2013,7 @@ .segment.language-stats { padding: 0; - height: 0.6em; + height: .6em; display: flex; white-space: nowrap; width: 100%; @@ -2023,7 +2023,7 @@ border: 0; padding: 0; margin: 0; - height: 0.6em; + height: .6em; } } } @@ -2226,7 +2226,7 @@ > .header, .segment { - box-shadow: 0 1px 2px 0 rgba(34, 36, 38, 0.15); + box-shadow: 0 1px 2px 0 rgba(34, 36, 38, .15); } } @@ -2248,7 +2248,7 @@ > .svg + .content { display: table-cell; - padding: 0 0 0 0.5em; + padding: 0 0 0 .5em; vertical-align: top; } @@ -2387,7 +2387,7 @@ display: table-cell; &.tiny { - height: 0.5em; + height: .5em; } } } @@ -2544,18 +2544,18 @@ tbody.commit-list { } .repo-buttons .disabled-repo-button .label { - opacity: 0.5; + opacity: .5; } .repo-buttons .disabled-repo-button a.button { - opacity: 0.5; + opacity: .5; cursor: not-allowed; } .repo-buttons .disabled-repo-button a.button:hover { background: none !important; - color: rgba(0, 0, 0, 0.6) !important; - box-shadow: 0 0 0 1px rgba(34, 36, 38, 0.15) inset !important; + color: rgba(0, 0, 0, .6) !important; + box-shadow: 0 0 0 1px rgba(34, 36, 38, .15) inset !important; } .repo-buttons .ui.labeled.button > .label { @@ -2607,5 +2607,5 @@ td.blob-excerpt { } .diff-file-box[data-folded="true"] .diff-file-header { - border-radius: 0.28571429rem !important; + border-radius: .28571429rem !important; } diff --git a/web_src/less/_review.less b/web_src/less/_review.less index 475fa5965..5d137e0c6 100644 --- a/web_src/less/_review.less +++ b/web_src/less/_review.less @@ -9,7 +9,7 @@ float: left; margin: 2px -10px 2px -20px; opacity: 0; - transition: transform 0.1s ease-in-out; + transition: transform .1s ease-in-out; transform: scale(1, 1); &:hover { @@ -53,12 +53,12 @@ } &.header { - padding: 0.1rem 1rem; + padding: .1rem 1rem; } } .right.menu.options .item { - padding: 0.85714286em 0.442857em; + padding: .85714286em .442857em; cursor: pointer; } @@ -82,7 +82,7 @@ display: inline-block; margin: 5px 0; font-size: 12px; - color: rgba(0, 0, 0, 0.6); + color: rgba(0, 0, 0, .6); } .ui.right.floated { @@ -97,7 +97,7 @@ } button.comment-form-reply { - margin: 0.5em 0.5em 0.5em 4.5em; + margin: .5em .5em .5em 4.5em; } form.comment-form-reply { @@ -107,7 +107,7 @@ .file-comment { font: 12px @monospaced-fonts, monospace; - color: rgba(0, 0, 0, 0.87); + color: rgba(0, 0, 0, .87); } .ui.fold-code { diff --git a/web_src/less/_tribute.less b/web_src/less/_tribute.less index ad097bef6..82ae6ee73 100644 --- a/web_src/less/_tribute.less +++ b/web_src/less/_tribute.less @@ -19,7 +19,7 @@ span.fullname { font-weight: normal; - font-size: 0.8rem; + font-size: .8rem; margin-left: 3px; } } diff --git a/web_src/less/_user.less b/web_src/less/_user.less index e9e41a01c..6acbb35ee 100644 --- a/web_src/less/_user.less +++ b/web_src/less/_user.less @@ -13,7 +13,7 @@ .header { font-weight: 700; font-size: 1.3rem; - margin-top: -0.2rem; + margin-top: -.2rem; line-height: 1.3rem; } diff --git a/web_src/less/themes/theme-arc-green.less b/web_src/less/themes/theme-arc-green.less index cee4ba5d9..a6f58e85d 100644 --- a/web_src/less/themes/theme-arc-green.less +++ b/web_src/less/themes/theme-arc-green.less @@ -1,7 +1,7 @@ .hljs { display: block; overflow-x: auto; - padding: 0.5em; + padding: .5em; color: #bababa; } @@ -86,7 +86,7 @@ body { * { scrollbar-width: thin; - scrollbar-color: #87ab63 rgba(255, 255, 255, 0.1); + scrollbar-color: #87ab63 rgba(255, 255, 255, .1); } /* webkit scrollbars */ @@ -99,14 +99,14 @@ body { ::-webkit-scrollbar-track { border-radius: 0 !important; - background: rgba(255, 255, 255, 0.1) !important; + background: rgba(255, 255, 255, .1) !important; } ::-webkit-scrollbar-thumb { cursor: pointer !important; border-radius: 5px !important; - -webkit-transition: color 0.2s ease !important; - transition: color 0.2s ease !important; + -webkit-transition: color .2s ease !important; + transition: color .2s ease !important; background: #87ab63 !important; } @@ -360,8 +360,8 @@ a.ui.basic.green.label:hover { .ui.basic.buttons .button:focus, .ui.basic.buttons .button:hover { color: #dbdbdb; - box-shadow: 0 0 0 1px rgba(200, 200, 200, 0.35) inset; - background: rgba(0, 0, 0, 0.5); + box-shadow: 0 0 0 1px rgba(200, 200, 200, .35) inset; + background: rgba(0, 0, 0, .5); } .ui.menu .item { @@ -532,12 +532,12 @@ a.ui.basic.green.label:hover { } .repository.wiki.new .ui.container form .ui.tabular.menu { - border-bottom: 1px solid rgba(187, 187, 187, 0.6); + border-bottom: 1px solid rgba(187, 187, 187, .6); .active.item { - border-top: 1px solid rgba(187, 187, 187, 0.6); - border-left: 1px solid rgba(187, 187, 187, 0.6); - border-right: 1px solid rgba(187, 187, 187, 0.6); + border-top: 1px solid rgba(187, 187, 187, .6); + border-left: 1px solid rgba(187, 187, 187, .6); + border-right: 1px solid rgba(187, 187, 187, .6); &:hover { background: #4b5162; } @@ -576,9 +576,9 @@ a.ui.basic.green.label:hover { .repository.file.editor.edit, .repository.wiki.new .CodeMirror { - border-right: 1px solid rgba(187, 187, 187, 0.6); - border-left: 1px solid rgba(187, 187, 187, 0.6); - border-bottom: 1px solid rgba(187, 187, 187, 0.6); + border-right: 1px solid rgba(187, 187, 187, .6); + border-left: 1px solid rgba(187, 187, 187, .6); + border-bottom: 1px solid rgba(187, 187, 187, .6); .editor-preview, .editor-preview-side, @@ -798,13 +798,13 @@ a.ui.basic.green.label:hover { .ui.selection.active.dropdown, .ui.selection.active.dropdown .menu { border-color: #4e5361; - box-shadow: 0 2px 3px 0 rgba(34, 36, 38, 0.15); + box-shadow: 0 2px 3px 0 rgba(34, 36, 38, .15); } .ui.selection.active.dropdown:hover, .ui.selection.active.dropdown:hover .menu { border-color: #4e5361; - box-shadow: 0 2px 3px 0 rgba(34, 36, 38, 0.15); + box-shadow: 0 2px 3px 0 rgba(34, 36, 38, .15); } .ui.selection.dropdown { @@ -936,9 +936,9 @@ input { } .ui.red.message { - background-color: rgba(80, 23, 17, 0.6); + background-color: rgba(80, 23, 17, .6); color: #f9cbcb; - box-shadow: 0 0 0 1px rgba(121, 71, 66, 0.5) inset, 0 0 0 0 transparent; + box-shadow: 0 0 0 1px rgba(121, 71, 66, .5) inset, 0 0 0 0 transparent; } .ui.red.button, @@ -987,7 +987,7 @@ input { .ui.checkbox .box:active::before, .ui.checkbox label:active::before { background: #304251; - border-color: rgba(34, 36, 38, 0.35); + border-color: rgba(34, 36, 38, .35); } .ui.checkbox input:focus ~ .box:before, @@ -1036,9 +1036,9 @@ input { } .ui.negative.message { - background-color: rgba(80, 23, 17, 0.6); + background-color: rgba(80, 23, 17, .6); color: #f9cbcb; - box-shadow: 0 0 0 1px rgba(121, 71, 66, 0.5) inset, 0 0 0 0 transparent; + box-shadow: 0 0 0 1px rgba(121, 71, 66, .5) inset, 0 0 0 0 transparent; } .hljs-tag, @@ -1132,7 +1132,7 @@ input { background-color: #2a2e3a !important; } td.blob-excerpt { - background-color: rgba(0, 0, 0, 0.15); + background-color: rgba(0, 0, 0, .15); } .code-view .active { @@ -1330,7 +1330,7 @@ a.ui.labels .label:hover { ::before { content: "\f0dd"; font: normal normal normal 14px/1 FontAwesome, serif; - font-size: 0.7em; + font-size: .7em; } } @@ -1349,7 +1349,7 @@ a.ui.labels .label:hover { td.xdsoft_other_month, td.xdsoft_disabled { - opacity: 0.8; + opacity: .8; background: #a0cc75; color: #000000; }