Hello friends.
Now I need personal .css in my project, but as I see my styles.css can’t be downloaded.
I have frontend package only with “generated” package and “index.html” inside, there is no ‘themes’ package there. As I undestand I use default theme.
Now I already created “themes” → “custom” packages, and 2 files in “custom”: styles.css and theme.json.
But as I see on project and in Network by browser Development Mode, no .css downloaded.
Please, help.
What do I do wrong?
My Vaadin version 24.7.0, Java 21 + Spring Boot 3.4.4
plugins {
id ‘java’
id ‘org.springframework.boot’ version ‘3.4.4’
id ‘io.spring.dependency-management’ version ‘1.1.7’
id ‘com.vaadin’ version ‘24.7.0’
}
Guys, thanks for your attempts to help.
I downgraded Java to version 17, good thing it didn’t take much time.
Also I created “default” package in “frontend”, and put there 2 files, styles.css and theme.json.
You will see current structure on screenshot.
My project now succesfully started, thank you so much, but no .css file downloaded just like before:(
Any more ideas?
I just want to download my .css in project. Unfortunately it doesn’t work either, as well as on Github.
I check in Development mode, no .css in Network.
Now I can download local .css for pade only by @StyleSheet(“./lazy-loaded.css”).
All css within frontend/theme is bundled together so there might be no additional network request (especially in development mode) - if your css isn’t applied, you are doing something wrong.
What is your use-case? Accessing your css externally? In that case using Spring’s public folder might help so that the resources below a specific path are accessible natively
Ohh… my good. Christian your are right. The correct styles have been applied and no .css in Network! Thank you so much.
May be you can help with another one moment, I need custom style for cell in vaadin grid, but only in one column, but can’t find it.
May be you can advice what complex code I should make for .css and java.
My column:
grid.addColumn(createToggleDetailsRenderer(grid))
.setWidth(“40px”)
.setFlexGrow(0)
.setFrozen(true);
and as i see in " Stylable Parts of Components" I should use vaadin-grid::part(cell) or vaadin-grid-cell-content How to style the Grid component | Vaadin components, but styles are applied either to all table or one column (but this column doesn’t render content) or not applied to anything at all.