Skip to content

Commit

Permalink
Undo some CSS resets from normalize/preflight that impacted Ladle's UI (
Browse files Browse the repository at this point in the history
  • Loading branch information
tajo committed May 11, 2022
1 parent c027c8c commit fa8db60
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-falcons-sin.md
@@ -0,0 +1,5 @@
---
"@ladle/react": major
---

Undo some basic CSS resets from normalize/preflight that impact Ladle's UI when used.
24 changes: 24 additions & 0 deletions packages/ladle/lib/app/ladle.css
Expand Up @@ -36,6 +36,12 @@ body {
flex-direction: column;
}

.ladle-aside img,
.ladle-aside svg {
display: inline;
vertical-align: baseline;
}

.ladle-main {
background-color: var(--ladle-bg-color-primary);
flex: 1 1 auto;
Expand Down Expand Up @@ -400,6 +406,18 @@ div[data-reach-dialog-overlay] {
font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
}

.ladle-addon-modal-body {
max-height: 80vh;
overflow: auto;
}

.ladle-addon-modal-body ul {
list-style: square;
overflow: auto;
margin: 8px;
padding-left: 40px;
}

@media (min-width: 768px) {
html,
body {
Expand All @@ -420,6 +438,10 @@ div[data-reach-dialog-overlay] {
overflow: hidden;
}

.ladle-aside {
box-sizing: content-box;
}

.ladle-main {
padding: 3em;
align-self: stretch;
Expand Down Expand Up @@ -447,9 +469,11 @@ div[data-reach-dialog-overlay] {

.ladle-aside li {
margin: 0.35em 0.35em;
line-height: 18px;
}

.ladle-aside input {
line-height: 1;
background-color: var(--ladle-bg-color-secondary);
}

Expand Down
9 changes: 1 addition & 8 deletions packages/ladle/lib/app/src/ui.tsx
Expand Up @@ -72,14 +72,7 @@ export const Modal: React.FC<{
<Close />
</Button>
</div>
<div
style={{
maxHeight: "80vh",
overflow: "auto",
}}
>
{children}
</div>
<div className="ladle-addon-modal-body">{children}</div>
</Dialog>
);
};

1 comment on commit fa8db60

@vercel
Copy link

@vercel vercel bot commented on fa8db60 May 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

ladle – ./

ladle.vercel.app
ladle.dev
ladle-miksu.vercel.app
ladle-git-master-miksu.vercel.app

Please sign in to comment.