Skip to content

Commit

Permalink
Style Book: clean up layout (#66255)
Browse files Browse the repository at this point in the history
Co-authored-by: ciampo <[email protected]>
Co-authored-by: DaniGuardiola <[email protected]>
Co-authored-by: ramonjd <[email protected]>
  • Loading branch information
4 people authored Oct 21, 2024
1 parent 55a7016 commit 75e3366
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 47 deletions.
65 changes: 32 additions & 33 deletions packages/edit-site/src/components/style-book/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,39 +120,38 @@ function StyleBook( {
>
{ resizeObserver }
{ showTabs ? (
<div className="edit-site-style-book__tabs">
<Tabs>
<div className="edit-site-style-book__tablist-container">
<Tabs.TabList>
{ tabs.map( ( tab ) => (
<Tabs.Tab
tabId={ tab.slug }
key={ tab.slug }
>
{ tab.title }
</Tabs.Tab>
) ) }
</Tabs.TabList>
</div>
{ tabs.map( ( tab ) => (
<Tabs.TabPanel
key={ tab.slug }
tabId={ tab.slug }
focusable={ false }
>
<StyleBookBody
category={ tab.slug }
examples={ examples }
isSelected={ isSelected }
onSelect={ onSelect }
settings={ settings }
sizes={ sizes }
title={ tab.title }
/>
</Tabs.TabPanel>
) ) }
</Tabs>
</div>
<Tabs>
<div className="edit-site-style-book__tablist-container">
<Tabs.TabList>
{ tabs.map( ( tab ) => (
<Tabs.Tab
tabId={ tab.slug }
key={ tab.slug }
>
{ tab.title }
</Tabs.Tab>
) ) }
</Tabs.TabList>
</div>
{ tabs.map( ( tab ) => (
<Tabs.TabPanel
key={ tab.slug }
tabId={ tab.slug }
focusable={ false }
className="edit-site-style-book__tabpanel"
>
<StyleBookBody
category={ tab.slug }
examples={ examples }
isSelected={ isSelected }
onSelect={ onSelect }
settings={ settings }
sizes={ sizes }
title={ tab.title }
/>
</Tabs.TabPanel>
) ) }
</Tabs>
) : (
<StyleBookBody
examples={ examples }
Expand Down
26 changes: 12 additions & 14 deletions packages/edit-site/src/components/style-book/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
&.is-button {
border-radius: $radius-large;
}

display: flex;
flex-direction: column;
align-items: stretch;
}

.edit-site-style-book__iframe {
Expand All @@ -18,22 +22,16 @@
}

.edit-site-style-book__tablist-container {
background: $white;
flex: none;

display: flex;
width: 100%;
padding-right: 56px;
display: flex;
position: absolute;
z-index: 1;
background: $white;
}

.edit-site-style-book__tabs {
[role="tabpanel"] {
bottom: 0;
left: 0;
overflow: auto;
padding: 0;
position: absolute;
right: 0;
top: $grid-unit-60; // Height of tabs.
}
.edit-site-style-book__tabpanel {
flex: 1 0 auto;

overflow: auto;
}

0 comments on commit 75e3366

Please sign in to comment.