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

Lack of cross-platform styling in SplitLayout #7094

Open
BlackSunshine-manage opened this issue Feb 5, 2025 · 1 comment
Open

Lack of cross-platform styling in SplitLayout #7094

BlackSunshine-manage opened this issue Feb 5, 2025 · 1 comment

Comments

@BlackSunshine-manage
Copy link

Description

Lack of cross-browser compatibility when initializing the property:

@import url(../global-styles.css);
@import url(color.css);

vaadin-split-layout::part(splitter) {
width: 0.85vw;
min-width: 0.55vw;
max-height: 85vh;
margin: 0 0 0 0;
border-radius: 5px;
background: linear-gradient(to right, LightSkyBlue, MediumSlateBlue) !important;
}

css file place: themes/{module-name}/components/vaadin-split-layout.css
Works on:

Firefox 134.0.2

Doesn't work on:
Microsoft Edge 132.0.2957.140

Google Chrome 132.0.6834.84

Vaadin version: 24.3.3

Expected outcome

Style background: linear-gradient(to right, LightSkyBlue, MediumSlateBlue) !important; work in all browsers, because it is guaranteed by the browser style portability contract https://developer.mozilla.org/en-US/docs/Web/CSS/gradient/linear-gradient

Minimal reproducible example

Create a SpritLayout in main as java project and add css file vaadin-split-layout.css:

vaadin-split-layout.css

vaadin-split-layout::part(splitter) {
width: 0.85vw;
min-width: 0.55vw;
max-height: 85vh;
margin: 0 0 0 0;
border-radius: 5px;
background: linear-gradient(to right, LightSkyBlue, MediumSlateBlue) !important;
}

Steps to reproduce

  1. create a minimal requirements for reproduce
  2. load application
  3. check split-layout splitter part

Environment

Vaadin version(s): 24.3.3
OS: windows 10 19045.4780

Browsers

Chrome

@web-padawan
Copy link
Member

css file place: themes/{module-name}/components/vaadin-split-layout.css

Please note that CSS using ::part() selector should be placed in global file. When placing styles in the components folder the corresponding CSS gets injected in the component's shadow root - see docs:

Stylesheets placed in a sub-folder called components, inside the application theme folder, and named according to the root HTML element of components, are automatically injected into the Shadow DOM of those components.

So, consider moving this style outside of components folder and then it should be working correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants