vaadin / docs

Official documentation for Vaadin and Hilla.
https://vaadin.com/docs
Other
27 stars 170 forks source link

Grid PartNameGenerator sample has unnecessary classname #3442

Open jflamy opened 1 month ago

jflamy commented 1 month ago

Description of the bug

On page https://vaadin.com/docs/latest/components/grid#part-name-generator The css example given uses as selector vaadin-grid.styling::part(high-rating)

I followed the directions to put this in my theme styles.css file, I had to remove the .styling part for this to work in version 24.3.12,

Expected behavior

The example should work.

Minimal reproducible example

See description

Versions

rolfsmeds commented 1 month ago

The styling example is actually correct. You missed that the Grid in the sample has the classname styling applied to it, and also used in the css selectors.

However, this is an unnecessary complication of the sample, and should be addressed (by removing the .styling classname from the selectors).

There is also a workaround in the sample for an issue in the way part names are applied, which should be fixed in the Grid component itself: https://github.com/vaadin/web-components/issues/7447

jflamy commented 1 month ago

Using "styling" as a class name for a grid was not exactly intuitive :-)

rolfsmeds commented 1 month ago

Keeping this open so we remember to remove the classname selector from the sample (and remove the classname entirely when https://github.com/vaadin/web-components/issues/7447 has been fixed).