[Discussion] Add component small: true Nunjucks option#1801
[Discussion] Add component small: true Nunjucks option#1801colinrotherham wants to merge 6 commits intosupport/10.xfrom
small: true Nunjucks option#1801Conversation
|
|
This is testing our gov alignment… It'd be a bit messier but we could perhaps defer to gov where the component is shared and only add flags like this for our own things, eg. small buttons. Or, if we're diverging here, we already have the |
|
I prefer We support |
| small: { | ||
| type: 'boolean', | ||
| required: false, | ||
| description: 'If set to `true`, smaller button size will be used.' | ||
| }, |
There was a problem hiding this comment.
If this was size instead of small here's an alternative for guidance
Effectively "s" would work but "m" (default) would be intentionally ignored
size: {
type: 'string',
required: false,
description: 'Size of the button – `"s"` or `"m"`. Defaults to `"m"`'
},This is a bit like .nhsuk-body and .nhsuk-body-m being aliases
There was a problem hiding this comment.
I think I prefer small: true here. It's inconsistent with size: "s" however it’s consistent with the terms used in the actual CSS classes.
And I think on balance it’s better to align to CSS, to make the param names easier to remember if you already know the CSS modifier. Also may help the designer-developer handover if the terms are aligned?
There was a problem hiding this comment.
Is it a cop out to suggest that that could be a separate search component (which includes both the input and the button)?
There was a problem hiding this comment.
Yeah, this PR for small: true was formed to solve that question regarding:
What do you think?
|
Alternative idea: Eg, One possible advantage is that it helps to imply that the variants are mutually exclusive, eg you can’t have a button that is both This wouldn't work for |
|
Or Bit like some of the card combos with |
|
@colinrotherham yeah, Potentially |
We're in a tricky case where the current NHS default sizings are often way bigger - and can look stupidly spacious in services. And probably a greater percentage of our stuff is (or could be?) business facing - so I see more of a need for compact variants of many things. A separate way of tackling it could be some kind of global modifier or config - generally setting the design system in to compact mode. That's probably not incompatible with individual components supporting a size though. |




Description
This PR proposes the
small: trueNunjucks option for discussionShould other modifiers be supported as flags like
secondary: trueetc already used by the card component?--inlineviainline: true--smallviasmall: true--reverseviareverse: true--secondary,--secondary-solidetcThese are all available in the NHS.UK React components
Checklist