Skip to content
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

Adjust selectors and classname for headers in Panels/Dialogs #210

Merged
merged 1 commit into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export function Dialog({
role={role}
tabIndex={-1}
>
<header>
<header className="Hyp-Dialog__header">
{icon && (
<div className="Hyp-Dialog__header-icon">
<SvgIcon name={icon} title={title} data-testid="header-icon" />
Expand Down
2 changes: 1 addition & 1 deletion src/components/Panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function Panel({ children, icon, onClose, title }) {
'Hyp-Panel--closeable': withCloseButton,
})}
>
<header>
<header className="Hyp-Panel__header">
{icon && (
<div className="Hyp-Panel__header-icon">
<SvgIcon name={icon} title={title} />
Expand Down
6 changes: 3 additions & 3 deletions src/pattern-library/components/patterns/PanelPatterns.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function OrganismPatterns() {
</p>
<Library.Demo withSource>
<div className="hyp-panel">
<header>
<header className="hyp-panel__header">
<h2 className="hyp-panel__title">
This is a panel title in a panel header
</h2>
Expand All @@ -61,7 +61,7 @@ export default function OrganismPatterns() {
</p>
<Library.Demo withSource>
<div className="hyp-panel hyp-panel--closeable">
<header>
<header className="hyp-panel__header">
<h2 className="hyp-panel__title">
Panel title on a closeable panel
</h2>
Expand All @@ -83,7 +83,7 @@ export default function OrganismPatterns() {
</p>
<Library.Demo withSource>
<div className="hyp-panel hyp-panel--closeable">
<header>
<header className="hyp-panel__header">
<h2 className="hyp-panel__title">Panel title</h2>
<div className="hyp-panel__close">
<IconButton icon="cancel" title="Close" />
Expand Down
5 changes: 1 addition & 4 deletions styles/mixins/patterns/_panels.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ $-color-brand: var.$color-brand;
@include atoms.border;
}

& > header,
&__header {
& > &__header {
@include layout.row($align: center);
@include layout.horizontal-spacing;
@include atoms.border(bottom);
Expand All @@ -45,13 +44,11 @@ $-color-brand: var.$color-brand;
// When there is an icon-only close button, tighten up affordances around the
// header as the button will have more height than the heading text. This has the
// effect of making the vertical space around the header look more even.
&--closeable > header,
&--closeable &__header {
padding-bottom: var.space(2);
margin-top: -1 * var.space(3);
}

&--closeable > header &__close,
&--closeable > &__header &__close {
// TODO replace font-sizing with appropriate approach when typography layer
// available.
Expand Down