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

Convert all Less files to Sass in discover, use EUI variable scope #21290

Merged
merged 2 commits into from
Aug 13, 2018

Conversation

going-confetti
Copy link
Contributor

@going-confetti going-confetti commented Jul 26, 2018

This PR removes the LESS files for the discover plugin and replaces them with Sass. It follows the same process taken in #20995
It is dependent on #21365

@@ -0,0 +1,6 @@
// EUI global scope
@import '../../../../node_modules/@elastic/eui/src/themes/k6/k6_globals';
@import '../../../../node_modules/@elastic/eui/src/themes/k6/k6_colors_light';
Copy link
Contributor

Choose a reason for hiding this comment

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

How does/will dark theme work if you are importing just the light colors?

Copy link
Contributor

Choose a reason for hiding this comment

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

@trevan The short term plan is:

During 6.5 dev we're converting all the Less files to Sass. We will maintain current "theming" capability (dark mode for dashboards). In the Dashboard's sass files, this will have a similar .theme-dark selector hack where the sass files will include k6_colors_dark and overwrite these top level imports.

Beyond that work we'd like to get full theming available through the switch of actual compiled css files (negating the need for the .theme-dark selector approach). This will open up all of Kibana to theming similar to what you can see on https://elastic.github.io/eui/#/

End goal is that Kibana at large should be theme-able by changing a few lines of Sass, which is why we're doing all this work now.

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

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

Good job. I'll need some time for a deeper scan in the browser but I didn't see anything specifically off.

I think you could probably do a pass where you used $eui sizing vars for a lot of the pixel values here. It would require you to pay more attention to the display in the browser (since some of these things line up).

If you're not comfortable, that's OK, either @cchaos or I can do it in a later pass.

You should feel safe deleting selectors if you don't see them used in the templates, which were the majority of my comments.

}

// SASSTODO: Seems that this selector is not used anywhere
visualize {
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks safe to delete. It looks like a style tag applies the height and the "spy" is removed.

}

// SASSTODO: Seems that this class is not used anywhere
.chartwrapper {
Copy link
Contributor

Choose a reason for hiding this comment

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

Safe to delete

}

// SASSTODO: Seems that this class is not used anywhere
.vis-overlay {
Copy link
Contributor

Choose a reason for hiding this comment

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

Safe to delete

}

// SASSTODO: seems like this class is not used anywhere
.discover-info {
Copy link
Contributor

Choose a reason for hiding this comment

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

Safe to delete

}

// SASSTODO: seems like this class is not used anywhere
.discover-info-title {
Copy link
Contributor

Choose a reason for hiding this comment

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

Safe to delete

margin-bottom: 3px;
}

.dscTable__timefield {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd remove this and replace it with .eui-textNoWrap in the template.

https://elastic.github.io/eui/#/utilities/css-utility-classes


// SASSTODO: seems like this class is not being used anywhere
.discover-field-details-count {
white-space: nowrap;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd remove this and replace it with .eui-textNoWrap in the template.

https://elastic.github.io/eui/#/utilities/css-utility-classes

padding-bottom: 0 !important; /* 1 */
height: $euiSizeXL;

&--active {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should probably write them out fully to make search/replace easier. @cchaos ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, besides we use full selector names everywhere. Fixed this one

}

// SASSTODO: Seems that .discover-field-details is not used anywhere
.discover-field-details {
Copy link
Contributor

Choose a reason for hiding this comment

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

Safe to delete

.discoverNoResultsShardFailure {
display: block;

.euiFlexItem:last-child {
Copy link
Contributor

Choose a reason for hiding this comment

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

Apply a new selector to the template on top. We never want to overwrite .eui classes in Kibana, even if its a deep selection like this.

<EuiFlexItem className="myThing">

@snide
Copy link
Contributor

snide commented Jul 27, 2018

I can help get the tests to pass once we're cleaned up. You'll also want to rebase or merge master against this branch to remove the conflict.

@going-confetti going-confetti force-pushed the sass/discover branch 3 times, most recently from 23f2031 to 682452d Compare July 27, 2018 16:14
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@snide snide requested a review from Bargs July 31, 2018 17:16
@snide
Copy link
Contributor

snide commented Jul 31, 2018

@Bargs @lukasolson We have a PR going that converts all of discovery's LESS files into SASS. There should be no visual changes, this is just converting the code and using EUI variables. Do either of you have time to do a review? Specifically just need you to look through discover in the browser and check for any breaks.

@snide snide requested a review from lukasolson July 31, 2018 17:18
@Bargs
Copy link
Contributor

Bargs commented Jul 31, 2018

I might be able to do a visual check later this week.

Copy link
Contributor

@Bargs Bargs left a comment

Choose a reason for hiding this comment

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

Just noticed one thing. After opening and closing one of the fields in the side bar the row retains the "active" styling.

screen shot 2018-08-02 at 2 46 03 pm

@elasticmachine
Copy link
Contributor

💔 Build Failed

@going-confetti
Copy link
Contributor Author

@Bargs Thanks, I just fixed the issue.

@snide
Copy link
Contributor

snide commented Aug 3, 2018

jenkins, retest this

@elasticmachine
Copy link
Contributor

💔 Build Failed

@snide
Copy link
Contributor

snide commented Aug 3, 2018

jenkins test this.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Member

@lukasolson lukasolson left a comment

Choose a reason for hiding this comment

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

LGTM, didn't notice anything out of place

Copy link
Contributor

@snide snide left a comment

Choose a reason for hiding this comment

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

Thanks @Bargs @lukasolson. We'll merge this as soon as we're unblocked by #21365.

@snide snide added the blocked label Aug 6, 2018
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@snide
Copy link
Contributor

snide commented Aug 10, 2018

jenkins, test this

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@snide
Copy link
Contributor

snide commented Aug 13, 2018

jenkins, retest this

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@snide snide merged commit eb43306 into elastic:master Aug 13, 2018
snide pushed a commit to snide/kibana that referenced this pull request Aug 13, 2018
snide added a commit that referenced this pull request Aug 13, 2018
cjcenizal pushed a commit to cjcenizal/kibana that referenced this pull request Aug 21, 2018
cjcenizal pushed a commit to cjcenizal/kibana that referenced this pull request Aug 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants