How to change font color of row in Grid vaadin ?

Those class names do not have any built-in meaning, you would need still to add vaadin-grid.css in your theme components folder with content

.success {
color: var(–lumo-success-text-color);
}
.primary {
color: var(–lumo-primary-text-color);
}

I don’t want to add more vaadin-grid.css into project .

Somehow to catch up class from grid or vaadin ? :eyes:

But you have to.

any class can inherit from grid or vaadin to display it , just remark the different between Male and Female gender, just change text color or background color also @quirky-zebra

No, because it’s in the shadow root. Use vaadin-grid.css

Not a good reason @quirky-zebra! @yummy-goat, would this work? Wrote a prototype to Viritin feature branch. I have missed something like this many times. Would be handy to make quick styling without becoming distracted CSS (and not to mention sharow root related CSS).

Ugly hack behind the scenes, but similar has done to job for me to style columns.

He is on Vaadin 14 :stuck_out_tongue_closed_eyes:

So no part name generator :sob:

@yummy-goat We need to get you to V24, it is 2024 afterall, what keeps you on V14?

Feature now in main branch of Viritin, but I think I’ll need to wait until afternoon to cut next release or Sonatype will ban my account for too many releases :nerd_face:

Full the scenario in my case, i use vaadin plugin 0.14.3.7

  1. java class with import css
    @CssImport(value = “./styles/components/message-grid.css”, themeFor = “vaadin-grid”)
    public class ShowDefineCheck
    {
    //code something with Grid generator color of text in cell grid
    _tblGrid.setClassNameGenerator(e → e.toString().contains(“Male”) ? “success-cell-grid” : “error-cell-grid”);
    }
  2. message-grid.css like this
    [part~=“cell”].Message-Error{
    color: var(–z_red);
    }

[part~=“cell”].Message-Warning,
[part~=“cell”].Message-Warn{
color: var(–z_blue);
}

.error-cell-grid
{
color:red;
}
.success-cell-grid
{
color:green;
}

@quintessential-ibex

@quirky-zebra

@yummy-rhino

Btw, i testing with this _tblGrid.setClassName(“success”); It’s work normal and all text cell changed green color in grid, not separate between Male or Female, it’s mean the classname “success” already exists. After that i tried to use it . But not working also
_tblGrid.setClassNameGenerator(e → e.toString().contains(“Male”) ? “success” : “error”);

So you expect that “success-cell-grid” is equals to “Message-Error”? No computer is going to say true to that

What is vaadin plugin 0.14.3.7 :thinking:

Gradle with Vaadin 14 :thinking: