Skip to content

Commit

Permalink
fixes: lists with floating images, headings in BlockText (#649)
Browse files Browse the repository at this point in the history
* preliminary fixes, but still some adjustments needed

* finalizing alignment of lists and floating media in student project steps, adding headings to blocktext story
  • Loading branch information
stephiescastle authored Oct 3, 2024
1 parent 7472761 commit 2a07d6b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
23 changes: 18 additions & 5 deletions packages/common/src/scss/components/_BlockText.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
h5,
h6 {
@apply mt-10 lg:mt-18 mb-5;

&:first-child {
@apply mt-0;
}
&:last-child {
@apply mb-0;
}
Expand Down Expand Up @@ -55,7 +57,13 @@

ol,
ul {
@apply mb-5 relative left-14 pr-14;
@apply mb-5 relative left-14 -ml-8 pr-14;
@screen sm {
@apply left-9;
li {
@apply w-full ml-8;
}
}

@screen lg {
@apply mb-8;
Expand Down Expand Up @@ -105,10 +113,10 @@
}
&.left,
&.right {
@apply mt-[.25rem] mb-5 lg:mb-5 mx-5 lg:mx-8;
@apply inline max-w-full sm:max-w-[50%];
@apply mt-[.25rem] mb-5 lg:mb-5 sm:mx-5 lg:mx-8;
@apply block max-w-full sm:max-w-[50%];
img {
@apply max-w-full h-auto;
@apply max-w-full h-auto;
}
}
&.left {
Expand All @@ -120,6 +128,11 @@
@apply sm:float-right mr-0;
// mimics offset in BlockInlineImage
@apply mr-0 lg:-mr-[5.3rem] xl:-mr-[6.8rem];
// prevents list items trom overlapping right-floating images
img,
.richtext-caption {
@apply sm:pl-6;
}
}
&:last-child {
@apply mb-0;
Expand Down
4 changes: 2 additions & 2 deletions packages/vue/src/components/BlockText/BlockText.stories.js

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

Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,16 @@ const { heading, blocks, image, steps, stepsNumbering, text } = reactive(props)
p,
li {
@screen lg {
@apply mr-[10rem];
@apply pr-[9rem];
}
@screen xl {
@apply mr-[14rem];
@apply pr-[13rem];
}
}
table {
p,
li {
@apply mr-0;
@apply pr-0;
}
}
}
Expand Down

0 comments on commit 2a07d6b

Please sign in to comment.