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

Documentation: Custom pattern states and CSS customization #1346

Open
renestalder opened this issue Aug 20, 2021 · 4 comments
Open

Documentation: Custom pattern states and CSS customization #1346

renestalder opened this issue Aug 20, 2021 · 4 comments

Comments

@renestalder
Copy link

The documentation for pattern states says, it is possible to add the custom styles for newly added states to ./source/css/pattern-scaffolding.css.

But is this actually true? Is the pattern-scaffolding.css able to overwrite styles in the Pattern Lab UIKit? I believe this is a mistake as to my knowledge, the pattern-scaffolding.css is only loaded via the _head file inside the iFrame of the rendered patterns and doesn't have access to the outside context.

Or I simply misunderstand the documentation.

@mfranzke
Copy link
Contributor

mfranzke commented Aug 20, 2021

You‘re right, ./source/css/pattern-scaffolding.css is loaded into the iframe and thatfor you‘re able to control the states (which are displayed as dots in there as well), but not within the left or top Patternlab menubar of the navigation.
I think we would need a similar possibility to easily tweak styles for that section / the UIKit as well. I think to remember some initiative on that, will have a look and come back to this.

@renestalder
Copy link
Author

Alright. Thanks for the confirmation.

@mfranzke
Copy link
Contributor

mfranzke commented Sep 5, 2021

I sadly haven't found anything during a quick research – so we should probably suggest a mechanism of how to add stylesheets (or probably HTML tags to the <head> in general, maybe this is another good use case) to the outer frame.

@mfranzke
Copy link
Contributor

mfranzke commented Nov 13, 2021

@renestalder I've release a fork of the https://www.npmjs.com/package/plugin-node-uiextension plugin: https://www.npmjs.com/package/@mfranzke/plugin-node-uiextension

This brings pattern lab 5 support and enables you as well to provide a stylesheet URL that would get embedded to the Pattern lab UI. That should solve your problem, by being able to add those individual stylesheets to that general UI now.

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

No branches or pull requests

3 participants