Skip to content

Commit

Permalink
feat: improve text section style
Browse files Browse the repository at this point in the history
  • Loading branch information
Thechi2000 committed Jan 10, 2024
1 parent 7b8d160 commit 732554f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 11 deletions.
4 changes: 1 addition & 3 deletions app/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ export default function Home(
<NewsCard news={n} />
))}
</div>
<Markdown className="markdown">
{props.association.attributes.about}
</Markdown>
<Markdown className="text">{props.association.attributes.about}</Markdown>
</>
);
}
Expand Down
53 changes: 45 additions & 8 deletions app/src/styles/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,57 @@ a {
}
}

.markdown {
.text {
min-width: 20ch;
max-width: 80ch;
padding: 0 1rem;
max-width: 60ch;
padding: 0 2rem;

border-radius: 1rem;
background-color: lightcyan;

a {
color: blue;
text-decoration: underline;
h1 {
text-align: center;
padding: 0 2rem;

&::after {
position: relative;
min-width: 4rem;
min-height: 0.3rem;
top: -0.45rem;
left: 0.5rem;

&:visited {
color: purple;
background-color: darkcyan;
content: "";
display: inline-block;
}
&::before {
@extend ::after;
left: -0.5rem;
}

// h4 (subtitle) must be centered and slightly enlarged
+ h4 {
text-align: center;
font-size: large;
}
}

// h4 is to be used as subtitle, thus we strip its top margin,
// and the bottom margin of the element just before (i.e. the
// element it is the subtitle of).
:has(+ h4) {
margin-bottom: 0;
}
h4 {
font-weight: lighter;
margin-top: 0.2rem;
}

a {
color: rgb(58, 127, 255);
}

p {
text-align: justify;
}
}

0 comments on commit 732554f

Please sign in to comment.