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

added sass lint to Canvas #43410

Merged
merged 4 commits into from
Aug 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .sass-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ files:
- 'src/legacy/ui/public/vislib/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/rollup/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/security/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/canvas/**/*.s+(a|c)ss'
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

rules:
quotes:
- 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
padding: $euiSizeXS $euiSize;
border: $euiBorderThin;
border-radius: $euiBorderRadius;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
font-size: inherit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
align-items: center;

.canvasRenderError__icon {
opacity: 0.4;
stroke: white;
stroke-width: 0.2px;
opacity: .4;
stroke: $euiColorEmptyShade;
stroke-width: .2px;

&:hover {
opacity: 0.6;
opacity: .6;
cursor: pointer;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@

// disables selection and dragging
.revealImage__image {
-khtml-user-select: none;
-o-user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
user-select: none;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $canvasLayoutFontSize: $euiFontSizeS;
.canvasLayout__stageHeader {
flex-grow: 0;
flex-basis: auto;
padding: ($euiSizeXS +1px) $euiSize $euiSizeXS $euiSize;
padding: ($euiSizeXS + 1px) $euiSize $euiSizeXS;
font-size: $canvasLayoutFontSize;
border-bottom: $euiBorderThin;
background: $euiColorLightestShade;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@

}

.canvasArg__form, .canvasArg__accordion {
.canvasArg__form,
.canvasArg__accordion {
&:hover {
.canvasArg__remove {
opacity: 1;
Expand Down Expand Up @@ -78,8 +79,9 @@
background: transparent;
}

&:before, &:after {
content: "";
&:before,
&:after {
content: '';
height: 1px;
position: absolute;
left: 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
}

.canvasAssetManager__meterWrapper {
flex-grow: 0;
min-width: 40%;
align-items: center;

@include euiBreakpoint('xs', 's') {
flex-grow: 1;
}
flex-grow: 0;
min-width: 40%;
align-items: center;
}

.canvasAssetManager__meterLabel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
text-align: center;

&:hover {
outline: solid 3px rgba(0, 121, 165, 0.1);
outline: solid $euiSizeXS transparentize($euiColorPrimary, .9);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
border-right: $euiBorderThin;
}

.autocompleteItems, .autocompleteReference {
.autocompleteItems,
.autocompleteReference {
@include euiScrollBar;
height: 258px;
Copy link
Contributor

Choose a reason for hiding this comment

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

Did it not yell about the pixel value here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, it's not giving any errors for px values. Maybe it needs to be configured or something?

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought for sure I set this up. I guess not. We don't have it on in EUI either. Something we can look into in a later PR.

https://github.com/sasstools/sass-lint/blob/master/docs/rules/variable-for-property.md

overflow: auto;
@include euiScrollBar;
}

.autocompleteReference {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
width: 8px;
margin-left: -4px;
margin-top: -4px;
background-color: #fff;
border: 1px solid #666;
box-shadow: 0 2px 2px -1px rgba(153, 153, 153, 0.3), 0 1px 5px -2px rgba(153, 153, 153, 0.3);
background-color: $euiColorEmptyShade;
border: 1px solid $euiColorDarkShade;
box-shadow: 0 2px 2px -1px transparentize($euiColorMediumShade, .7), 0 1px 5px -2px transparentize($euiColorMediumShade, .7);
Copy link
Contributor

Choose a reason for hiding this comment

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

Not 100% sure what this is used for, but a reminder we have a bunch of shadow mixins. They may or may not be a good sub.

https://github.com/elastic/eui/blob/master/src/global_styling/mixins/_shadow.scss

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.canvasColorPalette {
.canvasColorPalette__dot {
display: inline-block;
margin: 0px $euiSizeXS $euiSizeXS 0px;
margin: 0 $euiSizeXS $euiSizeXS 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
overflow: auto;

// removes white square in the scrollbar corner
&::-webkit-scrollbar-corner {
&::-webkit-scrollbar-corner { // sass-lint:disable-line no-vendor-prefixes
background: transparent;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
opacity: 0;
transition: opacity $euiAnimSpeedFast $euiAnimSlightResistance;
transition-delay: $euiAnimSpeedNormal;
background: transparentize($euiColorGhost, 0.5);
background: transparentize($euiColorGhost, .5);
border-radius: $euiBorderRadius;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
body.canvas-isFullscreen {
.canvas-isFullscreen {
ryankeairns marked this conversation as resolved.
Show resolved Hide resolved
// hide global loading indicator
.kbnLoadingIndicator {
display: none;
}

// remove space for global nav elements
.header-global-wrapper + .app-wrapper {
left: 0;
top: 0;
}

// set the background color
// This hex is OK, we always want it black
.canvasLayout {
background: #000; // This hex is OK, we always want it black
background: #000; // sass-lint:disable-line no-color-literals
Copy link
Contributor

Choose a reason for hiding this comment

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

$euiColorInk will give you this. It's always black.

}

// hide all the interface parts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
@for $i from 1 through 20 {
.canvasPageManager--trayPop > div:nth-child(#{$i}n) {
animation-delay: #{$i * 0.05}s;
animation-delay: #{$i * .05}s;
}
}

Expand Down Expand Up @@ -50,7 +50,7 @@

&:focus,
&-isActive {
background-color: transparentize(darken($euiColorLightestShade, 30%), 0.5);
background-color: transparentize(darken($euiColorLightestShade, 30%), .5);
outline: none;
text-decoration: none;
}
Expand All @@ -66,7 +66,7 @@
text-decoration: none;

.canvasPageManager__pagePreview {
@include euiBottomShadowMedium($opacity: 0.3);
@include euiBottomShadowMedium($opacity: .3);
}

.canvasPageManager__controls {
Expand All @@ -85,7 +85,7 @@
}

.canvasPageManager__pageNumber {
color: $euiColorDarkShade !important;
color: $euiColorDarkShade;
snide marked this conversation as resolved.
Show resolved Hide resolved
}

.canvasPageManager__pagePreview {
Expand All @@ -107,7 +107,7 @@
opacity: 0;
transition: opacity $euiAnimSpeedFast $euiAnimSlightResistance;
transition-delay: $euiAnimSpeedNormal;
background: transparentize($euiColorGhost, 0.5);
background: transparentize($euiColorGhost, .5);
border-radius: $euiBorderRadius;
}
}
Expand All @@ -117,10 +117,12 @@
opacity: 0;
transform: translateX(100%);
}

1% {
opacity: 0;
transform: translateX(100%);
}

100% {
opacity: 1;
transform: translateY(0);
Expand All @@ -132,10 +134,12 @@
opacity: 0;
transform: translateY(100%);
}

1% {
opacity: 0;
transform: translateY(100%);
}

100% {
opacity: 1;
transform: translateY(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}

.canvasPalettePicker__swatchesPanel {
padding: $euiSizeS 0 !important;
padding: $euiSizeS 0 !important; // sass-lint:disable-line no-important
}

.canvasPalettePicker__swatch {
Expand All @@ -27,6 +27,7 @@
.canvasPaletteSwatch__background {
transform: scaleY(2);
}

.canvasPalettePicker__label {
color: $euiTextColor;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.canvasRemove {
$clearSize: $euiSize;
@include size($clearSize); // sass-lint:disable-line mixins-before-declarations
position: absolute;
pointer-events: all;
@include size($clearSize);
background-color: $euiColorLightShade;
border-radius: $clearSize;
line-height: $clearSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
0% {
opacity: 0;
}

1% {
opacity: 0;
}

100% {
opacity: 1;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.canvasLayout__sidebarHeader {
padding: ($euiSizeXS * 0.5) 0;
padding: ($euiSizeXS * .5) 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

button {
padding: $euiSizeXS $euiSizeM;
box-shadow: 0 -2px 1px rgba($euiColorFullShade, .10)
box-shadow: 0 -2px 1px transparentize($euiColorFullShade, .9);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.canvasTray {
flex-direction: column;
@include euiBottomShadowFlat;
flex-direction: column;
}

.canvasTray__panel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
position: absolute;
user-select: none;
pointer-events: none;
background-image: linear-gradient(to right, grey 1px, transparent 1px),
linear-gradient(to bottom, grey 1px, transparent 1px);
background-image: linear-gradient(to right, $euiColorMediumShade 1px, transparent 1px),
linear-gradient(to bottom, $euiColorMediumShade 1px, transparent 1px);
background-size: 50px 50px;
top: 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
}

.canvasWorkpad__dropzoneTable--tags {

.euiTableCellContent {
flex-wrap: wrap;
}

.euiHealth {
width: 100%;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.canvasWorkpad__upload--compressed {

&.euiFilePicker--compressed.euiFilePicker {

.euiFilePicker__prompt {
height: $euiSizeXXL;
padding: $euiSizeM;
padding-left: $euiSizeXXL;
}

.euiFilePicker__icon {
top: $euiSizeM;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.canvasPage {
@include euiBottomShadowFlat($opacity: .4);
z-index: initial;
@include euiBottomShadowFlat($opacity: 0.4);
position: absolute;
top: 0;
transform-style: preserve-3d !important;
transform-style: preserve-3d !important; // sass-lint:disable-line no-important
background-color: $euiColorEmptyShade;
}
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/canvas/public/style/hackery.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
when the UI framework implements everything we need
*/

#canvas-app {
#canvas-app { // sass-lint:disable-line no-ids
// Give buttons some room to the right
.euiAccordion__childWrapper {
overflow-x: hidden;
Expand Down
Loading