[Maps] Cleanup SASS and add linting (#47211) (#47611)

* Enabling sass lint compressed maps

* Fixing linting error in all maps sass files
This commit is contained in:
Elizabet Oliveira 2019-10-09 14:28:21 +01:00 committed by GitHub
parent e927e5fb92
commit 111e5d1d06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 71 additions and 50 deletions

View file

@ -8,6 +8,7 @@ files:
- 'x-pack/legacy/plugins/security/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/canvas/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/lens/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/maps/**/*.s+(a|c)ss'
rules:
quotes:
- 2

View file

@ -1,5 +1,6 @@
@import '@elastic/eui/src/components/header/variables';
// sass-lint:disable no-ids
#maps-plugin {
display: flex;
flex-direction: column;
@ -9,6 +10,7 @@
}
.mapFullScreen {
// sass-lint:disable no-important
height: 100vh !important;
}

View file

@ -27,12 +27,14 @@
// Also fixes dark mode
.mapboxgl-ctrl-icon.mapboxgl-ctrl-zoom-in {
background-repeat: no-repeat;
// sass-lint:disable-block quotes
background-image: url("data:image/svg+xml,%0A%3Csvg width='15px' height='15px' viewBox='0 0 15 15' version='1.1' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='#{hexToRGB($euiTextColor)}' d='M8,7 L8,3.5 C8,3.22385763 7.77614237,3 7.5,3 C7.22385763,3 7,3.22385763 7,3.5 L7,7 L3.5,7 C3.22385763,7 3,7.22385763 3,7.5 C3,7.77614237 3.22385763,8 3.5,8 L7,8 L7,11.5 C7,11.7761424 7.22385763,12 7.5,12 C7.77614237,12 8,11.7761424 8,11.5 L8,8 L11.5,8 C11.7761424,8 12,7.77614237 12,7.5 C12,7.22385763 11.7761424,7 11.5,7 L8,7 Z M7.5,15 C3.35786438,15 0,11.6421356 0,7.5 C0,3.35786438 3.35786438,0 7.5,0 C11.6421356,0 15,3.35786438 15,7.5 C15,11.6421356 11.6421356,15 7.5,15 Z' /%3E%3C/svg%3E");
background-position: center;
}
.mapboxgl-ctrl-icon.mapboxgl-ctrl-zoom-out {
background-repeat: no-repeat;
// sass-lint:disable-block quotes
background-image: url("data:image/svg+xml,%0A%3Csvg width='15px' height='15px' viewBox='0 0 15 15' version='1.1' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='#{hexToRGB($euiTextColor)}' d='M7.5,0 C11.6355882,0 15,3.36441176 15,7.5 C15,11.6355882 11.6355882,15 7.5,15 C3.36441176,15 0,11.6355882 0,7.5 C0,3.36441176 3.36441176,0 7.5,0 Z M3.5,7 C3.22385763,7 3,7.22385763 3,7.5 C3,7.77614237 3.22385763,8 3.5,8 L11.5,8 C11.7761424,8 12,7.77614237 12,7.5 C12,7.22385763 11.7761424,7 11.5,7 L3.5,7 Z' /%3E%3C/svg%3E");
background-position: center;
}

View file

@ -0,0 +1,11 @@
.mapGeometryFilter__geoFieldSuperSelect {
height: $euiSizeL * 2;
}
.mapGeometryFilter__geoFieldSuperSelectWrapper {
height: $euiSizeL * 3;
}
.mapGeometryFilter__geoFieldItem {
padding: $euiSizeXS;
}

View file

@ -1,35 +1,2 @@
.mapMetricEditorPanel {
margin-bottom: $euiSizeS;
}
.mapMetricEditorPanel__metricEditor {
padding: $euiSizeM 0;
border-top: $euiBorderThin;
&:first-child {
padding-top: 0;
border-top: none;
}
&:last-child {
margin-bottom: $euiSizeM;
border-bottom: 1px solid $euiColorLightShade;
}
}
.mapMetricEditorPanel__metricRemoveButton {
padding-top: $euiSizeM;
text-align: right;
}
.mapGeometryFilter__geoFieldSuperSelect {
height: $euiSizeL * 2;
}
.mapGeometryFilter__geoFieldSuperSelectWrapper {
height: $euiSizeL * 3;
}
.mapGeometryFilter__geoFieldItem {
padding: $euiSizeXS;
}
@import './metric_editors';
@import './geometry_filter';

View file

@ -0,0 +1,23 @@
.mapMetricEditorPanel {
margin-bottom: $euiSizeS;
}
.mapMetricEditorPanel__metricEditor {
padding: $euiSizeM 0;
border-top: $euiBorderThin;
&:first-child {
padding-top: 0;
border-top: none;
}
&:last-child {
margin-bottom: $euiSizeM;
border-bottom: 1px solid $euiColorLightShade;
}
}
.mapMetricEditorPanel__metricRemoveButton {
padding-top: $euiSizeM;
text-align: right;
}

View file

@ -1,13 +1,16 @@
.mapLayerAddpanel__card {
// EUITODO: Fix horizontal layout so it works with any size icon
.euiCard__content {
// sass-lint:disable-block no-important
padding-top: 0 !important;
.euiBetaBadge {
margin: 0 12px !important;
}
}
.euiCard__top + .euiCard__content {
// sass-lint:disable-block no-important
padding-top: 2px !important;
}
}

View file

@ -30,7 +30,8 @@
}
.mapLayerPanel__sourceDetail {
margin-bottom: 0px !important;
// sass-lint:disable-block no-important
margin-bottom: 0 !important;
}
.mapLayerPanel__footer {

View file

@ -32,6 +32,6 @@
}
.mapJoinExpressionHelpText {
padding-top: 0px;
padding-top: 0;
padding-bottom: $euiSizeS;
}

View file

@ -1,5 +1,6 @@
.mapFeatureTooltip_table {
width: 100%;
td {
padding: $euiSizeXS;
}

View file

@ -9,6 +9,7 @@
.mapToolbarOverlay__button {
@include size($euiSizeXL);
// sass-lint:disable-block no-important
background-color: $euiColorEmptyShade !important;
pointer-events: all;

View file

@ -1,12 +1,12 @@
@mixin mapOverlayIsTextOnly() {
@mixin mapOverlayIsTextOnly {
text-shadow:
0 0 2px $euiColorEmptyShade,
// Multiple shadows helps turn it into an outline since
// text shadows have no spread value
0 0 1px $euiColorEmptyShade,
0 0 1px $euiColorEmptyShade,
0 0 1px $euiColorEmptyShade,
0 0 1px $euiColorEmptyShade,
0 0 1px $euiColorEmptyShade,
0 0 1px $euiColorEmptyShade;
0 0 2px $euiColorEmptyShade,
// Multiple shadows helps turn it into an outline since
// text shadows have no spread value
0 0 1px $euiColorEmptyShade,
0 0 1px $euiColorEmptyShade,
0 0 1px $euiColorEmptyShade,
0 0 1px $euiColorEmptyShade,
0 0 1px $euiColorEmptyShade,
0 0 1px $euiColorEmptyShade;
}

View file

@ -4,7 +4,7 @@
* individual widgets.
*/
.mapWidgetOverlay {
.mapWidgetOverlay {
position: absolute;
z-index: $euiZLevel1;
top: $euiSizeM;
@ -29,6 +29,7 @@
width: 100%;
overflow: hidden;
padding-bottom: $euiSizeS; // ensures the scrollbar doesn't appear unnecessarily because of flex group negative margins
// sass-lint:disable-block no-important
border-color: transparent !important;
flex-direction: column;
display: flex;

View file

@ -1,6 +1,7 @@
.mapLayerControl {
@include euiScrollBar;
overflow-y: auto;
// sass-lint:disable-block no-important
flex-basis: auto !important; // Fixes IE and ensures the layer items are visible
padding-bottom: $euiSizeS + 1px;
border-top: 1px solid $euiColorLightestShade;
@ -24,5 +25,6 @@
.mapLayerControl__openLayerTOCButton,
.mapLayerControl__closeLayerTOCButton {
@include size($euiSizeXL);
// sass-lint:disable-block no-important
background-color: $euiColorEmptyShade !important; // During all states
}

View file

@ -37,6 +37,7 @@
.mapTocEntry-isDraggingOver {
background-color: $euiColorEmptyShade;
// Don't allow interaction events while layer is being re-ordered
// sass-lint:disable-block no-important
pointer-events: none !important;
}
@ -50,12 +51,13 @@
flex-grow: 1;
}
.mapLayTocActions__popoverAnchor, .mapLayTocActions__tooltipAnchor{
.mapLayTocActions__popoverAnchor,
.mapLayTocActions__tooltipAnchor {
max-width: 100%;
}
.mapTocEntry-notVisible .mapTocEntry__layerName {
opacity: 0.5;
opacity: .5;
}
.mapTocEntry__grab:hover {
@ -116,9 +118,11 @@
}
@keyframes mapTocEntryBecomeVisible {
0% {
opacity: 0;
}
100% {
opacity: 1;
}

View file

@ -28,9 +28,11 @@
}
@keyframes mapColorStopBecomeVisible {
0% {
opacity: 0;
}
100% {
opacity: 1;
}