Update usage of the title component #3918
Open
+19
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Why
We're updating the component spacing model to make it more consistent and having a margin_top option isn't part of the intended outcome.
Visual changes
For the coronavirus landing page the title component used the
margin_top: 0
option, so we replace the component with the heading component, which means no visual change (app/views/coronavirus_landing_page/components/landing_page/_page_header.html.erb).For the development index page we replace the title component with the heading component. This results in a small visual change, but this is a non-public facing page so isn't a concern (app/views/development/index.html.erb).
For the taxon pages the title component used the
margin_top: 0
option, so we replace the component with the heading component, which means no visual change (app/views/taxons/_page_header.html.erb).For the world location news pages the title component used the
margin_top: 0
option, but requires the 'context' feature of the title component (not available in the heading component) so we keep it as it is, but remove the option (app/views/world_location_news/show.html.erb). This currently will not produce a visual difference until we merge alphagov/govuk_publishing_components#4508 at which point it will change as shown below (only on desktop and tablet, mobile remains unchanged). I think this change is acceptable, as the title seems quite squashed against the breadcrumb in this instance.