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

DataViews styling is broken outside of the edit-site context #60292

Closed
paulwilde opened this issue Mar 28, 2024 · 3 comments
Closed

DataViews styling is broken outside of the edit-site context #60292

paulwilde opened this issue Mar 28, 2024 · 3 comments
Labels
[Feature] Data Views Work surrounding upgrading and evolving views in the site editor and beyond [Feature] Extensibility The ability to extend blocks or the editing experience [Type] Bug An existing feature does not function as intended

Comments

@paulwilde
Copy link
Contributor

paulwilde commented Mar 28, 2024

Description

I've looked at converting an existing table list to work with the new DataViews which is shipping with 6.5, however it appears that the styling for it only works within the edit-site context as the styling for the component is stored within edit-site/style.css.

Step-by-step reproduction instructions

  1. Add a <DataViews /> onto a post edit content.
  2. See that the styling is broken.

Screenshots, screen recording, code snippet

How <DataViews /> looks without styling:

image

How <DataViews /> should look when the styling is duplicated across:

image

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@paulwilde paulwilde added the [Type] Bug An existing feature does not function as intended label Mar 28, 2024
@t-hamano t-hamano added the [Feature] Data Views Work surrounding upgrading and evolving views in the site editor and beyond label Mar 29, 2024
@annezazu
Copy link
Contributor

annezazu commented Apr 2, 2024

@oandregal could you perhaps give some guidance and feedback here? I imagine this has to do with the extensibility not yet being in place outside of the edit-site context but would love confirmation.

@annezazu annezazu added the [Feature] Extensibility The ability to extend blocks or the editing experience label Apr 2, 2024
@oandregal
Copy link
Member

Hey Paul: yes, this has to do with the @wordpress/dataviews package being "experimental".

Most of the packages expose a style handle you'd be able to declare in your plugin as a dependency, as well as a global variable. For example, the @wordpress/components packages exposes a wp-components style handle and a wp.components global variable. When we do that, we are bound by backward-compatibility and we won't do breaking changes.

With dataviews, we're still refining the proper APIs, so we don't expose its styles or global variable — we call this a "bundled package". At some point, I presume we'll expose dataviews styles/APIs the same way we do for components. But it's not there yet.

In the interim, what you can do is to bundle the dataviews styles in your plugin.

@annezazu
Copy link
Contributor

annezazu commented Apr 9, 2024

Closing this out with the answer above :) Thank you.

@annezazu annezazu closed this as completed Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Data Views Work surrounding upgrading and evolving views in the site editor and beyond [Feature] Extensibility The ability to extend blocks or the editing experience [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants