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 trigger padding #102

Merged
merged 9 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 4 additions & 1 deletion _extensions/closeread/closeread.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _extensions/closeread/closeread.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions _extensions/closeread/closeread.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,17 @@
padding-block: 45svh;
padding-inline: 1em;

p {
margin-bottom: 0; // override bootstrap rule
.narrative {

padding: 0.75em;

// override bootstrap margin when using a single paragraph trigger
// (but not when wrapping multiple pars with a div)
> p {
margin-bottom: 0;
}
}

}
}

Expand Down Expand Up @@ -132,7 +140,7 @@
.narrative {
background-color: rgba(17, 17, 17, .85);
color: white;
padding: 5px;
padding: 5px; // TODO
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO meaning consider revisiting if you want to tweak?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note to self: don't get distracted halfway through writing a TODO 😂

I think I originally modified this property, realised this was inside the mobile layout, intended to decide whether this property was needed at all and then got distracted 😬 I think 0.75rem is a good bit of padding for all layouts though tbh, so I'm tempted to remove this altogether!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With padding: 5px on mobile:

image

With 0.75em (what I've set other layouts to):

image

0.3rem (vertical) and 0.5rem (horizontal) is a snugger but maybe balance that I think might better work for very small screens:

image

You could take a bit off the vertical for wider widths too! Maybe 0.7 0.75em?

border-radius: 5px;
}
}
Expand All @@ -159,7 +167,7 @@
.narrative {
background-color: rgba(17, 17, 17, .85);
color: white;
padding: 5px;
padding: 5px; // TODO
border-radius: 5px;
}
}
Expand Down
3 changes: 2 additions & 1 deletion docs/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ Step two: open up a closeread section. [@cr-doc]{highlight="8-20"}

Step three: flag an element to become a sticky. [@cr-doc]{highlight="14-18"}

:::{focus-on="cr-doc" highlight="12" style="padding-bottom: 100dvh"}
Step four: create a trigger to make the sticky appear. [@cr-doc]{highlight="12"}

:::{style="height: 40dvh; visibility: hidden"}
:::

:::{#cr-doc filename="myfirstcr.qmd"}
Expand Down