hmrc / component-library-template

Template files for HMRC's component library
1 stars 16 forks source link

SDT-723 Make Nav Items Sentence case #55

Closed gordonmcmullan closed 6 years ago

gordonmcmullan commented 6 years ago

Added a sentenceCase helper in the style of the titleCase helper and used it in place of the titleCase helper in the navigation item macros.

Went down this path rather than switching to css text-transforms as it was a smaller change. Ad the sentence case helper might be more generally useful too.

Note: The Actual Nav items may not show the sentence casing if there is only one '.' in the name of the directory as the path.name property is being used rather than path.base.

gavinwye commented 6 years ago

Is this an automatic change @gordonmcmullan or will people need to do something to make this happen? Also what happens if we need to use title case for some things?

gordonmcmullan commented 6 years ago

Yes I believe this an automatic change @gavinwye Once it's merged the next build assets-frontend will update the Design-System site.

I've left the titleCase() helper function alone, it's still usable if you want to Title Case something.

stevenaproctor commented 6 years ago

@gordonmcmullan Is there a way to use what is rendered as the H1 from the markdown file? The page title, H1 and left menu should be the same and there could be:

gordonmcmullan commented 6 years ago

@stevenaproctor, it's software, infinitely malleable, so yes it's possible. But it's likely to be a much more wide ranging change. The question(s) then become(s). Is this an improvement on what we have? How important is this new feature compared with all the other things we could be doing?

stevenaproctor commented 6 years ago

@gordonmcmullan It is important for a design system to practise what it preaches. I noticed the title case navigation and HMRC Design System page title on every page. The first one does not follow GOV.UK style and the second breaks a WCAG rule for accessibility.

I believe making the labelling consistent is important. I just wanted to understand how difficult or long it would take to do.

gordonmcmullan commented 6 years ago

@stevenaproctor, I'm not sure how long it would take right now, and investigating it would delay us getting some of the other recent PRs on the Design System and assets-frontend merged & released.

We can park this PR till after we've done the other work if you like, but that might mean accepting the current appearance till after the new year.

gavinwye commented 6 years ago

I think we should be aiming to mirror the GOV.UK design system as we will eventually be adopting that.

Here's a screenshot of what they have. screenshot 2017-12-19 10 36 57

gordonmcmullan commented 6 years ago

screenshot from 2017-12-19 12-20-40

This is the appearance of the Component Tab after the change

stevenaproctor commented 6 years ago

@gordonmcmullan Do not hold the PR. The case and how something displays is something to keep in mind though in case we run into problems later.