Skip to content

[SharedUX] SCSS migration of kibana_react plugin#216450

Merged
paulinashakirova merged 8 commits into
elastic:mainfrom
paulinashakirova:scss-migration-kibana_react-plugin
Apr 7, 2025
Merged

[SharedUX] SCSS migration of kibana_react plugin#216450
paulinashakirova merged 8 commits into
elastic:mainfrom
paulinashakirova:scss-migration-kibana_react-plugin

Conversation

@paulinashakirova
Copy link
Copy Markdown
Contributor

@paulinashakirova paulinashakirova commented Mar 31, 2025

Summary

This PR is a part of SCSS migration of SharedUX team code.
Here is a meta issue for it.

@paulinashakirova paulinashakirova added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// labels Mar 31, 2025
@paulinashakirova paulinashakirova self-assigned this Mar 31, 2025
@paulinashakirova paulinashakirova requested a review from a team as a code owner March 31, 2025 11:31
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@paulinashakirova paulinashakirova marked this pull request as draft March 31, 2025 11:32
@paulinashakirova paulinashakirova marked this pull request as ready for review April 2, 2025 19:33
@paulinashakirova paulinashakirova requested a review from a team as a code owner April 2, 2025 19:33
@paulinashakirova paulinashakirova marked this pull request as draft April 2, 2025 19:34
const kbnMarkdownAlphaLightShade = `rgba(${euiTheme.colors.fullShade}, .15)`;
// Reverse grayscale for opposite of theme
const kbnMarkdownAlphaLightestShadeReversed = `rgba(${euiTheme.colors.emptyShade}, .05)`;
const kbnMarkdownAlphaLightShadeReversed = `rgba(${euiTheme.colors.emptyShade}, .15)`;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

using "fullShade" "emptyShade" is said to be deprecated, but since it is a legacy code which was reverted for a specific purpose I decided to go with these variables to stick closer to the original.

td,
th {
padding: 0;
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was showing in dev tools that

The display: table-header-group property prevents padding from having an effect.
Try setting display to something other than table-header-group.

So it had no effect anyways.

@paulinashakirova paulinashakirova marked this pull request as ready for review April 3, 2025 14:22
@paulinashakirova paulinashakirova requested a review from a team as a code owner April 3, 2025 14:22
@paulinashakirova paulinashakirova marked this pull request as draft April 3, 2025 16:06
@paulinashakirova paulinashakirova marked this pull request as ready for review April 3, 2025 16:16
Copy link
Copy Markdown
Contributor

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

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

Vis changes LGTM

// 8. Code blocks

export const markdownStyles = (isReversed: boolean) => {
const { euiTheme } = useEuiTheme();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I know it seems this works, but could we instead pass the value of euiTheme from an invocation of useEuiTheme from a component.

Comment on lines 56 to 58
const markdownClasses = classNames('kbnMarkdown__body', {
'kbnMarkdown__body--reversed': isBackgroundInverted(panelBackgroundColor),
'kbnMarkdown__body--reversed': isReversed,
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the markdownClasses declaration can be moved into the markdown component; we already set the kbnMarkdown__body class within our component, also since we already receive the isReversed prop within the component, we can also set the kbnMarkdown__body--reversed class in there, what's more I don't think we actually need to explicitly pass it since our new styles actually have no reference to it, however we should confirm that this classname is not being arbitrarily target from elsewhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

our new styles actually have no reference to it,

Yes, and this was my research as well, but then...

this classname is not being arbitrarily target from elsewhere.

I got worried that maybe this is something that is custom targeted from outside.

My research showed that it was used before the migration along with other visualizations, but when they were migrated - this was removed.

Since it is the legacy code - I didn't feel confident removing because of the reason it was brought back in the first place...
@eokoneyo Is there a way to check for custom implementation from outside?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since we aren't too sure, I suppose we can keep it around, however I think we can should contain the application of the classname within the markdown component.

Copy link
Copy Markdown
Contributor

@eokoneyo eokoneyo left a comment

Choose a reason for hiding this comment

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

Thanks for making these changes!

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
kibanaReact 247 230 -17

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
kibanaReact 194.0KB 187.5KB -6.5KB
visTypeTimeseries 484.5KB 484.5KB -19.0B
total -6.6KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
kibanaReact 28.6KB 23.8KB -4.8KB

History

cc @paulinashakirova

@paulinashakirova paulinashakirova merged commit bc415d6 into elastic:main Apr 7, 2025
@paulinashakirova paulinashakirova deleted the scss-migration-kibana_react-plugin branch April 7, 2025 15:06
baileycash-elastic pushed a commit to baileycash-elastic/kibana that referenced this pull request Apr 7, 2025
## Summary

This PR is a part of SCSS migration of SharedUX team code.
Here is a [meta](elastic/kibana-team#1417)
issue for it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes scss-removal Team:SharedUX Platform AppEx-SharedUX (formerly Global Experience) t// v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants