Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LESS is more #9023

Merged
merged 9 commits into from
Jan 31, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 3 additions & 4 deletions superset/assets/src/SqlLab/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,9 @@ div.Workspace {

div.tablePopover {
opacity: 0.7 !important;
}

div.tablePopover:hover {
opacity: 1 !important;
&:hover {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a styling thing, but personally i prefer a new line between normal styles and the &:foo { line. I think there's a way to lint for that, if so maybe you could add that rule in another PR. if not, maybe we could start standardizing that here if you agree?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer that too, but glad you caught ones I missed. I'll look for a linting rule.

opacity: 1 !important;
}
}

.ResultSetControls {
Expand Down
7 changes: 3 additions & 4 deletions superset/assets/src/components/RefreshLabel.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
*/
@import '../../stylesheets/less/variables.less';

.RefreshLabel:hover {
color: @brand-primary;
}

.RefreshLabel {
color: @bs-gray-light;
&:hover {
color: @brand-primary;
}
}
15 changes: 7 additions & 8 deletions superset/assets/src/dashboard/stylesheets/buttons.less
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@
align-items: center;
justify-content: center;
outline: none;
}

.icon-button:hover,
.icon-button:active,
.icon-button:focus {
color: @almost-black;
outline: none;
text-decoration: none;
&:hover,
&:active,
&:focus {
color: @almost-black;
outline: none;
text-decoration: none;
}
}

.icon-button-label {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

.dashboard--editing {
.grid-column:after {
border: 1px solid transparent;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol, what was this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a bunch of fairly convoluted styles around the dashed borders in the dashboard editor, which seem like they could use a simplification effort (a future PR, probably). I'll double check that this one wasn't providing some useful 1px offset.

content: '';
position: absolute;
width: 100%;
Expand All @@ -37,8 +36,6 @@
left: 0;
z-index: @z-index-chart;
pointer-events: none;
}
.grid-column:after {
border: 1px dashed @gray-light;
}
.resizable-container.resizable-container--resizing:hover > .grid-column:after,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
padding: 16px;
background: @lightest;
cursor: move;
}

.new-component:not(.static):hover {
background: @gray-bg;
&:not(.static):hover {
background: @gray-bg;
}
}

.new-component-placeholder {
Expand Down
42 changes: 21 additions & 21 deletions superset/assets/src/dashboard/stylesheets/components/tabs.less
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@
padding: 12px 0 14px 0;
font-size: @font-size-m;
margin-right: 0;
}

& > a:hover {
border: none;
background: inherit;
color: @almost-black;
}
&:hover {
border: none;
background: inherit;
color: @almost-black;
}

& > a:focus {
outline: none;
background: @lightest;
&:focus {
outline: none;
background: @lightest;
}
}

& .dragdroppable-tab {
Expand Down Expand Up @@ -82,19 +82,19 @@

& li.active > a {
border: none;
}

& li.active > a:after {
content: '';
position: absolute;
height: 3px;
width: 100%;
bottom: 0;
background: linear-gradient(
to right,
@indicator-color,
shade(@indicator-color, @colorstop-two)
);
&:after {
content: '';
position: absolute;
height: 3px;
width: 100%;
bottom: 0;
background: linear-gradient(
to right,
@indicator-color,
shade(@indicator-color, @colorstop-two)
);
}
}
}

Expand Down
138 changes: 70 additions & 68 deletions superset/assets/src/dashboard/stylesheets/popover-menu.less
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,28 @@
font-size: @font-size-m;
cursor: default;
z-index: @z-index-max;

.menu-item {
display: flex;
flex-direction: row;
align-items: center;
}

/* vertical spacer after each menu item */
.menu-item:not(:only-child):not(:last-child):after {
content: '';
width: 1;
height: 100%;
background: @gray-light;
margin: 0 16px;
}

.popover-dropdown.btn {
border: none;
padding: 0;
font-size: inherit;
color: @almost-black;
}
}

/* the focus menu doesn't account for parent padding */
Expand All @@ -68,41 +90,28 @@
left: -7px;
}

.popover-menu .menu-item {
display: flex;
flex-direction: row;
align-items: center;
.popover-menu .popover-dropdown.btn,
.hover-dropdown .btn {
&:hover,
&:active,
&:focus {
background: initial;
box-shadow: none;
}
}

/* vertical spacer after each menu item */
.popover-menu .menu-item:not(:only-child):not(:last-child):after {
content: '';
width: 1;
height: 100%;
background: @gray-light;
margin: 0 16px;
}

.popover-menu .popover-dropdown.btn {
border: none;
padding: 0;
font-size: inherit;
color: @almost-black;
}

.popover-menu .popover-dropdown.btn:hover,
.popover-menu .popover-dropdown.btn:active,
.popover-menu .popover-dropdown.btn:focus,
.hover-dropdown .btn:hover,
.hover-dropdown .btn:active,
.hover-dropdown .btn:focus {
background: initial;
box-shadow: none;
}

.hover-dropdown li.dropdown-item:hover a,
.popover-menu li.dropdown-item:hover a {
background: @menu-hover;
.hover-dropdown,
.popover-menu {
li.dropdown-item {
&:hover a {
background: @menu-hover;
}
&.active a {
background: @gray-light;
font-weight: @font-weight-bold;
color: @almost-black;
}
}
}

.popover-dropdown .caret {
Expand All @@ -111,43 +120,36 @@
border-top-color: transparent;
}

.hover-dropdown li.dropdown-item.active a,
.popover-menu li.dropdown-item.active a {
background: @gray-light;
font-weight: @font-weight-bold;
color: @almost-black;
}

/* background style menu */
.background-style-option {
display: inline-block;
}

.background-style-option:before {
content: '';
width: 1em;
height: 1em;
margin-right: 8px;
display: inline-block;
vertical-align: middle;
}

.background-style-option.background--white {
padding-left: 0;
background: transparent;
}

.background-style-option.background--white:before {
background: @lightest;
border: 1px solid @gray-light;
}

/* Create the transparent rect icon */
.background-style-option.background--transparent:before {
background-image: linear-gradient(45deg, @gray 25%, transparent 25%),
linear-gradient(-45deg, @gray 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, @gray 75%),
linear-gradient(-45deg, transparent 75%, @gray 75%);
background-size: 8px 8px;
background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
&:before {
content: '';
width: 1em;
height: 1em;
margin-right: 8px;
display: inline-block;
vertical-align: middle;
}

&.background--white {
padding-left: 0;
background: transparent;

&:before {
background: @lightest;
border: 1px solid @gray-light;
}
}

/* Create the transparent rect icon */
&.background--transparent:before {
background-image: linear-gradient(45deg, @gray 25%, transparent 25%),
linear-gradient(-45deg, @gray 25%, transparent 25%),
linear-gradient(45deg, transparent 75%, @gray 75%),
linear-gradient(-45deg, transparent 75%, @gray 75%);
background-size: 8px 8px;
background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
}
}