-
Notifications
You must be signed in to change notification settings - Fork 20
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
Create shared helper for components #759
Conversation
652e13b
to
ed518c2
Compare
ed518c2
to
b78e24c
Compare
b78e24c
to
445d188
Compare
70ec4d0
to
0866905
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @andysellick.
I left a few comments, otherwise looks great. And I'm not sure about the name shared_helper
, but I guess makes its purpose clear and it's something we can change if we feel like.
app/assets/stylesheets/govuk_publishing_components/components/_textarea.scss
Show resolved
Hide resolved
207f026
to
de41373
Compare
@alex-ju thanks for the comments. Yeah, I struggled with the name a bit. I went with that because it was the clearest and shortest thing I could think of. Happy to change it later if we can think of something better. |
- provides margin bottom for components
- for margin bottom
- restructure textarea slightly to put margin on wrapping element rather than textarea itself, as those two margins were conflicting - set default margin to be 6, overriding default of 3 in shared helper, means this will be a non-breaking change - add margin option to documentation
- defaults to no margin as per original behaviour
- update shared helper to return a span if heading level 0 is passed, instead of a heading level - retain the default of h2 if nothing or an invalid value is passed
de41373
to
78bad64
Compare
A number of the components are now using the same or similar code for setting a margin bottom and creating a heading level. This PR creates a single shared component helper that provides that functionality in one place, and updates those components that need it to use it.
Trello card: https://trello.com/c/DCHfrY2s/82-draft-create-a-shared-set-of-helper-functions-to-be-used-across-components