-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add secondary
variant to CardTitle
and CardHeader
#1001
Conversation
@@ -4,7 +4,15 @@ import type { JSX } from 'preact'; | |||
import type { PresentationalProps } from '../../types'; | |||
import { downcastRef } from '../../util/typing'; | |||
|
|||
type ComponentProps = { | |||
/** Wrap the title with this HTML heading tag */ | |||
tagName?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5'; |
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.
I realized that we lost something in the most recent round of Card
and Panel
implementations: we aren't using heading elements. For HTML semantics and accessibility it is best if we do. This prop allows a consumer to use a different heading level than default (h1) if so desired.
Codecov Report
@@ Coverage Diff @@
## main #1001 +/- ##
===========================================
- Coverage 100.00% 99.85% -0.15%
===========================================
Files 53 53
Lines 700 707 +7
Branches 238 244 +6
===========================================
+ Hits 700 706 +6
- Misses 0 1 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I'll fix the test miss tomorrow. |
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.
LGTM
className={classnames( | ||
{ | ||
'text-lg text-brand font-semibold': variant === 'primary', | ||
'text-xl text-slate-7 font-normal': variant === 'secondary', |
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.
Is the text supposed to be bigger on secondary
variant? Is that intended?
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.
Yes, it actually is!
This expresses a design pattern we are using in the `lms` application.
5f470fb
to
dfa231f
Compare
This PR expresses a design pattern we are using in the
lms
application by updatingvariants
forCardTitle
andCardHeader
to add a newsecondary
variant (default isprimary
, the way it "looked before.").This captures the pattern we've started using in panels in the
lms
app. It will make markup more straightforward for LMS components, and make prototyping within panels of that style faster and more consistent.Partial screen grab of updated
Card
pattern library page, in theCardHeader
section: