Skip to content

Commit

Permalink
Rethink judgment paragraph numbering layout on small breakpoint
Browse files Browse the repository at this point in the history
A slightly 'creative' solution in code terms, but I think design-wise it makes sense (credit for which goes to Jim).

At the smallest breakpoint, hanging section numbers take up too much screen real estate making the judgement hard to read. Instead, we indent the first line of the para after the number, making the para numbers easily recognisable while not losing  whole length of the line for text.
  • Loading branch information
timcowlishaw committed Sep 23, 2022
1 parent 754d5b6 commit 949e94f
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions ds_judgements_public_ui/sass/includes/_judgment_text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@
}

&__number {
@media (max-width: $grid__breakpoint-medium) {
padding-right: $spacer__unit;
}

&:target {
animation-duration: 1.5s;
animation-name: emphasis-border;
Expand All @@ -213,20 +217,64 @@
}

&__section {

@media (max-width: $grid__breakpoint-medium) {
> div {
display: inline;
&::after {
content: " ";
display: block;
}
p {
display: inline;
&::after {
content: " ";
display: block;
margin-bottom: $spacer__unit;
}
}
}
}

@media (min-width: $grid__breakpoint-medium) {
display: grid;
grid-template-columns: 1fr 15fr;
grid-template-rows: 1fr;
gap: 0 $spacer__unit * 0.5;
grid-template-areas: ". .";
}
}


&__nested-section {

@media (max-width: $grid__breakpoint-medium) {
margin-left: $spacer__unit;

> div {
display: inline;
&::after {
content: " ";
display: block;
}
p {
display: inline;
&::after {
content: " ";
display: block;
margin-bottom: $spacer__unit;
}
}
}
}

@media (min-width: $grid__breakpoint-medium) {
display: grid;
grid-template-columns: 1fr 24fr;
grid-template-rows: 1fr;
gap: 0 $spacer__unit * 0.5;
grid-template-areas: ". .";
}
}

&__indent {
Expand Down

0 comments on commit 949e94f

Please sign in to comment.