kibana/.github
Marta Bondyra de3604c905
Create @kbn/css-utils package (#223933)
## 🧵 Summary

This PR introduces a few structural and cleanup improvements:

1. Moves core Emotion CSS helpers (`useMemoizedStyles` renamed as
`useMemoCss`, `kbnFullBodyHeightCss`, `kbnFullScreenBgCss`) from
`core/public` to a new package: `@kbn/css-utils`.
2. Removes a significant portion of legacy SCSS from the core plugin. 
3. Replaces scss mixin with emotion `kbnFullScreenBgCss` across Kibana
(we have scss and emotion version, but emotion version wasn't widely
used yet).
4. As a result of (3), some plugin tests were migrated to React Testing
Library. This was necessary because Emotion-generated snapshots in
Enzyme were difficult to read and maintain when moving to emotion.

### Considerations
I initially tried to add the package to the [shared-deps
bundle](8e15517ddd),
but couldn’t get the SVG imports for `kbnFullScreenBgCss` to work
correctly in that setup.

As a workaround, I opted to import the helpers directly from their
source files.

An alternative approach could be to convert the used SVGs into React
components and use those within the shared package. Or explore something
like a static package and try to somehow wire in that in the webpack
internal compilers, but it doesn't seem to be worth the effort at the
moment.


### 💡 Motivation

- These utils don’t need to live in Core and are now decoupled to
improve performance and flexibility.
- Importing from `core/public` (even just for a small hook) was adding
noticeable overhead to test runs:
  - ~1–2s delay on first Jest execution
  - ~200ms added on subsequent runs
  - Occasional CI timeouts due to deep import graph

### 👥 Ownership

I assigned this package to sharedux team. Thank you!

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-06-20 22:48:44 +02:00
..
codeql chore: exclude new solution-specific test folders from CodeQL scans (#222741) 2025-06-05 07:53:24 +00:00
ISSUE_TEMPLATE Remove 8.0 breaking change template (#157044) 2023-05-08 15:25:24 -04:00
updatecli/values.d ci(bump automation): bump ubi9 for ironbank (#191660) 2024-10-10 22:00:38 +02:00
workflows Update actions/checkout digest to 09d2aca (main) (#222934) 2025-06-06 22:32:10 +00:00
CODEOWNERS Create @kbn/css-utils package (#223933) 2025-06-20 22:48:44 +02:00
ISSUE_TEMPLATE.md Add elasticsearch version to issue template 2016-07-25 11:00:27 -05:00
paths-labeller.yml Change path to observability_ai_assistant_management following reloca… (#218571) 2025-04-17 16:41:55 +01:00
PULL_REQUEST_TEMPLATE.md Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-core (#201653) 2025-01-04 11:47:24 -07:00
relabel.yml Improve needs-team auto labeling regex (#143787) 2022-10-27 09:03:34 -07:00
stale.yml Remove Infra Monitoring UI team (#175745) 2024-01-30 13:33:57 -06:00