-
-
Notifications
You must be signed in to change notification settings - Fork 694
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
react: styling improvements for gherkin components #1391
Conversation
What would you think about the possibility to propose several styles through optional themes? |
@aurelien-reeves yes definitely, that should be nice and easy with custom properties. I’ll run an example up today and work on the CSS modularisation too. @aslakhellesoy raised this in lieu of an issue, hope that’s okay? |
I've added CSS modules now - see Customisation comes from CSS custom properties, which could be set from a custom stylesheet, plus built-in themes can be activated via the Inevitable dark theme: |
OMG this looks awesome! 😍 And very clean scss + minimal logic. I'd love to make it obvious to consumers of I've had an idea about a styling system/API. It's a inspired by React-Markdown Custom Renderers. A custom renderer would typically use a component from the library, and pass custom I think it's important to get this styling story straight. That way it will become much easier to adopt and tailor to users' needs. LMK what you think |
@aslakhellesoy yep I know what you mean. If we could make that |
939e35c
to
7cbb29e
Compare
I accidentally edited the summary in this PR thinking I was editing #1564 - I've done my best to restore it (reverting the edits wasn't possible). |
@davidjgoss do you think we can merge this to main now? |
@aslakhellesoy yep I'm happy if you are. |
Let's do it! I'll create a new issue with various remaining styling niggles I'd like to address. I'll merge when the CI is green. |
Summary
Improve styling and CSS architecture of gherkin components in
@cucumber/react
.Introduce an MDG component for rendering Markdown features.
Details
Styles are colocated and encapsulated with presentational components via (S)CSS modules. This means we are now producing processed CSS output via webpack in the
html-formatter
build, not just copying some stylesheets fromreact
- this is reflected in some makefile and code changes.An optional
CustomRendering
component enables customisation of styles via providing own CSS classes, or even overriding of React rendering. This is intentionally for a small subset of presentationalcomponents at this point.
Theming is enabled via CSS custom properties - we could conceivably let people set these via
--formatOptions
.More detail in the updated
README.md
. There are also new stories in Storybook illustrating what's possible with the customisation.Motivation and Context
Screenshots (if appropriate):
You can preview here in Storybook form:
https://serene-wilson-f8fc77.netlify.app/
Types of changes
Checklist: