Merge pull request #2901 from matrix-org/dbkr/fix_style_linting

Fix style lint errors & enable on CI
pull/21833/head
David Baker 2019-04-09 15:29:13 +01:00 committed by GitHub
commit 40bb6465fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 155 additions and 144 deletions

View File

@ -3,6 +3,7 @@ steps:
command: command:
- "yarn install" - "yarn install"
- "yarn lintwithexclusions" - "yarn lintwithexclusions"
- "yarn stylelint"
plugins: plugins:
- docker#v3.0.1: - docker#v3.0.1:
image: "node:10" image: "node:10"

View File

@ -3,5 +3,13 @@ module.exports = {
"rules": { "rules": {
"indentation": 4, "indentation": 4,
"comment-empty-line-before": null, "comment-empty-line-before": null,
"declaration-empty-line-before": null,
"length-zero-no-unit": null,
"rule-empty-line-before": null,
"color-hex-length": null,
"max-empty-lines": null,
"number-no-trailing-zeros": null,
"number-leading-zero": null,
"selector-list-comma-newline-after": null,
} }
} }

View File

@ -29,6 +29,9 @@ yarn lintall -f checkstyle -o eslint.xml || true
# re-run the linter, excluding any files known to have errors or warnings. # re-run the linter, excluding any files known to have errors or warnings.
yarn lintwithexclusions yarn lintwithexclusions
# lint styles
yarn stylelint
# delete the old tarball, if it exists # delete the old tarball, if it exists
rm -f matrix-react-sdk-*.tgz rm -f matrix-react-sdk-*.tgz

View File

@ -14,6 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* This file has CSS for both native and non-native scrollbars in an
* order that's fairly logic to read but violates stylelints descending
* specificity rule, so turn it off for this file. It also duplicates
* a selector to separate the hiding/showing from the sizing.
*/
/* stylelint-disable no-descending-specificity, no-duplicate-selectors */
/* /*
1. for browsers that support native overlay auto-hiding scrollbars 1. for browsers that support native overlay auto-hiding scrollbars
*/ */
@ -59,8 +66,7 @@ body.mx_scrollbar_nooverlay {
*/ */
.mx_AutoHideScrollbar:hover.mx_AutoHideScrollbar_overflow > .mx_AutoHideScrollbar_offset, .mx_AutoHideScrollbar:hover.mx_AutoHideScrollbar_overflow > .mx_AutoHideScrollbar_offset,
.mx_AutoHideScrollbar:hover.mx_AutoHideScrollbar_overflow::before, .mx_AutoHideScrollbar:hover.mx_AutoHideScrollbar_overflow::before,
.mx_AutoHideScrollbar:hover.mx_AutoHideScrollbar_overflow::after .mx_AutoHideScrollbar:hover.mx_AutoHideScrollbar_overflow::after {
{
margin-right: calc(-1 * var(--scrollbar-width)); margin-right: calc(-1 * var(--scrollbar-width));
} }
} }

View File

@ -54,7 +54,7 @@ limitations under the License.
border-bottom: 8px solid transparent; border-bottom: 8px solid transparent;
} }
.mx_ContextualMenu_chevron_right:after { .mx_ContextualMenu_chevron_right::after {
content: ''; content: '';
width: 0; width: 0;
height: 0; height: 0;
@ -81,7 +81,7 @@ limitations under the License.
border-bottom: 8px solid transparent; border-bottom: 8px solid transparent;
} }
.mx_ContextualMenu_chevron_left:after{ .mx_ContextualMenu_chevron_left::after {
content: ''; content: '';
width: 0; width: 0;
height: 0; height: 0;
@ -108,7 +108,7 @@ limitations under the License.
border-right: 8px solid transparent; border-right: 8px solid transparent;
} }
.mx_ContextualMenu_chevron_top:after{ .mx_ContextualMenu_chevron_top::after {
content: ''; content: '';
width: 0; width: 0;
height: 0; height: 0;
@ -135,7 +135,7 @@ limitations under the License.
border-right: 8px solid transparent; border-right: 8px solid transparent;
} }
.mx_ContextualMenu_chevron_bottom:after{ .mx_ContextualMenu_chevron_bottom::after {
content: ''; content: '';
width: 0; width: 0;
height: 0; height: 0;

View File

@ -101,10 +101,10 @@ limitations under the License.
padding-left: 0px; padding-left: 0px;
} }
.mx_FilePanel .mx_EventTile:hover .mx_EventTile_line {
background-color: $primary-bg-color;
}
.mx_FilePanel .mx_EventTile_selected .mx_EventTile_line { .mx_FilePanel .mx_EventTile_selected .mx_EventTile_line {
padding-left: 0px; padding-left: 0px;
} }
.mx_FilePanel .mx_EventTile:hover .mx_EventTile_line {
background-color: $primary-bg-color;
}

View File

@ -67,11 +67,6 @@ limitations under the License.
z-index: 6; z-index: 6;
} }
.mx_LeftPanel_container.collapsed .mx_BottomLeftMenu {
flex: 0 0 160px;
margin-bottom: 9px;
}
.mx_LeftPanel .mx_BottomLeftMenu { .mx_LeftPanel .mx_BottomLeftMenu {
order: 3; order: 3;
@ -82,6 +77,11 @@ limitations under the License.
z-index: 1; z-index: 1;
} }
.mx_LeftPanel_container.collapsed .mx_BottomLeftMenu {
flex: 0 0 160px;
margin-bottom: 9px;
}
.mx_LeftPanel .mx_BottomLeftMenu_options { .mx_LeftPanel .mx_BottomLeftMenu_options {
margin-top: 18px; margin-top: 18px;
} }

View File

@ -52,7 +52,7 @@ limitations under the License.
background-color: $roomheader-addroom-bg-color; background-color: $roomheader-addroom-bg-color;
position: relative; position: relative;
&:before { &::before {
background-color: $roomheader-addroom-fg-color; background-color: $roomheader-addroom-fg-color;
mask: url('$(res)/img/icons-create-room.svg'); mask: url('$(res)/img/icons-create-room.svg');
mask-repeat: no-repeat; mask-repeat: no-repeat;
@ -113,8 +113,7 @@ limitations under the License.
overflow-x: hidden; overflow-x: hidden;
display: flex; display: flex;
flex-direction: row; flex-flow: row wrap;
flex-flow: wrap;
align-content: flex-start; align-content: flex-start;
} }
@ -153,6 +152,7 @@ limitations under the License.
.mx_GroupTile_profile .mx_GroupTile_groupId { .mx_GroupTile_profile .mx_GroupTile_groupId {
font-size: 13px; font-size: 13px;
opacity: 0.7;
} }
.mx_GroupTile_profile .mx_GroupTile_desc { .mx_GroupTile_profile .mx_GroupTile_desc {
@ -163,7 +163,3 @@ limitations under the License.
max-height: 36px; max-height: 36px;
overflow: hidden; overflow: hidden;
} }
.mx_GroupTile_profile .mx_GroupTile_groupId {
opacity: 0.7;
}

View File

@ -83,14 +83,14 @@ limitations under the License.
padding-right: 0px; padding-right: 0px;
} }
.mx_NotificationPanel .mx_EventTile:hover .mx_EventTile_line {
background-color: $primary-bg-color;
}
.mx_NotificationPanel .mx_EventTile_selected .mx_EventTile_line { .mx_NotificationPanel .mx_EventTile_selected .mx_EventTile_line {
padding-left: 0px; padding-left: 0px;
} }
.mx_NotificationPanel .mx_EventTile:hover .mx_EventTile_line {
background-color: $primary-bg-color;
}
.mx_NotificationPanel .mx_EventTile_content { .mx_NotificationPanel .mx_EventTile_content {
margin-right: 0px; margin-right: 0px;
} }

View File

@ -89,7 +89,7 @@ limitations under the License.
flex: 0 0 16px; flex: 0 0 16px;
position: relative; position: relative;
&:before { &::before {
background-color: $roomheader-addroom-fg-color; background-color: $roomheader-addroom-fg-color;
mask: url('$(res)/img/icons-room-add.svg'); mask: url('$(res)/img/icons-room-add.svg');
mask-repeat: no-repeat; mask-repeat: no-repeat;
@ -137,6 +137,26 @@ limitations under the License.
padding: 0 8px; padding: 0 8px;
} }
.collapsed {
.mx_RoomSubList_scroll {
padding: 0;
}
.mx_RoomSubList_labelContainer {
margin-right: 14px;
margin-left: 2px;
}
.mx_RoomSubList_addRoom {
margin-left: 3px;
margin-right: 10px;
}
.mx_RoomSubList_label > span {
display: none;
}
}
// overflow indicators // overflow indicators
.mx_RoomSubList:not(.resized-all) > .mx_RoomSubList_scroll { .mx_RoomSubList:not(.resized-all) > .mx_RoomSubList_scroll {
&.mx_IndicatorScrollbar_topOverflow::before, &.mx_IndicatorScrollbar_topOverflow::before,
@ -177,24 +197,3 @@ limitations under the License.
} }
*/ */
} }
.collapsed {
.mx_RoomSubList_scroll {
padding: 0;
}
.mx_RoomSubList_labelContainer {
margin-right: 14px;
margin-left: 2px;
}
.mx_RoomSubList_addRoom {
margin-left: 3px;
margin-right: 10px;
}
.mx_RoomSubList_label > span {
display: none;
}
}

View File

@ -86,36 +86,6 @@ limitations under the License.
flex: 1 1 0; flex: 1 1 0;
} }
.mx_RoomView_body {
position: relative; //for .mx_RoomView_auxPanel_fullHeight
display: flex;
flex-direction: column;
flex: 1;
min-width: 0;
}
.mx_RoomView_body .mx_RoomView_timeline {
/* offset parent for mx_RoomView_topUnreadMessagesBar */
position: relative;
flex: 1;
display: flex;
flex-direction: column;
}
.mx_RoomView_body {
.mx_RoomView_messagePanel, .mx_RoomView_messagePanelSpinner, .mx_RoomView_messagePanelSearchSpinner{
order: 2;
}
}
.mx_RoomView_body .mx_RoomView_statusArea {
order: 3;
}
.mx_RoomView_body .mx_MessageComposer {
order: 4;
}
.mx_RoomView_messagePanel { .mx_RoomView_messagePanel {
width: 100%; width: 100%;
overflow-y: auto; overflow-y: auto;
@ -132,7 +102,7 @@ limitations under the License.
position: relative; position: relative;
} }
.mx_RoomView_messagePanelSearchSpinner:before { .mx_RoomView_messagePanelSearchSpinner::before {
background-color: $greyed-fg-color; background-color: $greyed-fg-color;
mask: url('$(res)/img/feather-customised/search-input.svg'); mask: url('$(res)/img/feather-customised/search-input.svg');
mask-repeat: no-repeat; mask-repeat: no-repeat;
@ -146,6 +116,62 @@ limitations under the License.
height: 50px; height: 50px;
} }
.mx_RoomView_body {
position: relative; //for .mx_RoomView_auxPanel_fullHeight
display: flex;
flex-direction: column;
flex: 1;
min-width: 0;
.mx_RoomView_messagePanel, .mx_RoomView_messagePanelSpinner, .mx_RoomView_messagePanelSearchSpinner {
order: 2;
}
}
.mx_RoomView_body .mx_RoomView_timeline {
/* offset parent for mx_RoomView_topUnreadMessagesBar */
position: relative;
flex: 1;
display: flex;
flex-direction: column;
}
.mx_RoomView_statusArea {
width: 100%;
flex: 0 0 auto;
max-height: 0px;
background-color: $primary-bg-color;
z-index: 1000;
overflow: hidden;
transition: all .2s ease-out;
}
.mx_RoomView_statusArea_expanded {
max-height: 100px;
}
.mx_RoomView_statusAreaBox {
margin: auto;
min-height: 50px;
}
.mx_RoomView_statusAreaBox_line {
margin-left: 65px;
border-top: 1px solid $primary-hairline-color;
height: 1px;
}
.mx_RoomView_body .mx_RoomView_statusArea {
order: 3;
}
.mx_RoomView_body .mx_MessageComposer {
order: 4;
}
.mx_RoomView_messageListWrapper { .mx_RoomView_messageListWrapper {
min-height: 100%; min-height: 100%;
@ -206,33 +232,6 @@ hr.mx_RoomView_myReadMarker {
z-index: 1; z-index: 1;
} }
.mx_RoomView_statusArea {
width: 100%;
flex: 0 0 auto;
max-height: 0px;
background-color: $primary-bg-color;
z-index: 1000;
overflow: hidden;
transition: all .2s ease-out;
}
.mx_RoomView_statusArea_expanded {
max-height: 100px;
}
.mx_RoomView_statusAreaBox {
margin: auto;
min-height: 50px;
}
.mx_RoomView_statusAreaBox_line {
margin-left: 65px;
border-top: 1px solid $primary-hairline-color;
height: 1px;
}
.mx_RoomView_callStatusBar .mx_UploadBar_uploadProgressInner { .mx_RoomView_callStatusBar .mx_UploadBar_uploadProgressInner {
background-color: $primary-bg-color; background-color: $primary-bg-color;
} }

View File

@ -50,7 +50,7 @@ limitations under the License.
color: $tab-label-active-fg-color; color: $tab-label-active-fg-color;
} }
.mx_TabbedView_maskedIcon {; .mx_TabbedView_maskedIcon {
margin-left: 6px; margin-left: 6px;
margin-right: 9px; margin-right: 9px;
margin-top: 1px; margin-top: 1px;
@ -59,7 +59,7 @@ limitations under the License.
display: inline-block; display: inline-block;
} }
.mx_TabbedView_maskedIcon:before { .mx_TabbedView_maskedIcon::before {
display: inline-block; display: inline-block;
background-color: $tab-label-icon-bg-color; background-color: $tab-label-icon-bg-color;
mask-repeat: no-repeat; mask-repeat: no-repeat;
@ -71,7 +71,7 @@ limitations under the License.
vertical-align: middle; vertical-align: middle;
} }
.mx_TabbedView_tabLabel_active .mx_TabbedView_maskedIcon:before { .mx_TabbedView_tabLabel_active .mx_TabbedView_maskedIcon::before {
background-color: $tab-label-active-icon-bg-color; background-color: $tab-label-active-icon-bg-color;
} }

View File

@ -36,7 +36,6 @@ limitations under the License.
flex: none; flex: none;
display: flex;
justify-content: center; justify-content: center;
align-items: flex-start; align-items: flex-start;

View File

@ -23,12 +23,12 @@ limitations under the License.
padding: 17px 0 3px 0; padding: 17px 0 3px 0;
} }
.mx_TagPanelButtons > .mx_GroupsButton:before { .mx_TagPanelButtons > .mx_GroupsButton::before {
mask: url('$(res)/img/feather-customised/users.svg'); mask: url('$(res)/img/feather-customised/users.svg');
mask-position: center 11px; mask-position: center 11px;
} }
.mx_TagPanelButtons > .mx_TagPanelButtons_report:before { .mx_TagPanelButtons > .mx_TagPanelButtons_report::before {
mask: url('$(res)/img/feather-customised/life-buoy.svg'); mask: url('$(res)/img/feather-customised/life-buoy.svg');
mask-position: center 9px; mask-position: center 9px;
} }
@ -43,7 +43,7 @@ limitations under the License.
/* overwrite mx_RoleButton inline-block */ /* overwrite mx_RoleButton inline-block */
display: block !important; display: block !important;
&:before { &::before {
background-color: $tagpanel-bg-color; background-color: $tagpanel-bg-color;
mask-repeat: no-repeat; mask-repeat: no-repeat;
content: ''; content: '';