Skip to content

Commit

Permalink
chore: improve styling
Browse files Browse the repository at this point in the history
  • Loading branch information
abtx committed Aug 22, 2023
1 parent 5b3e762 commit 2b5c38d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 27 deletions.
11 changes: 4 additions & 7 deletions src/components/GlossarySearch/GlossaryCard.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
.glossary-term__card {
display: flex;
flex-direction: column;
justify-content: space-between;
gap: .5rem;
padding: 1rem;
padding: 1rem 1.5rem;
border: 1px solid var(--border-color);
border-radius: 8px;
transition: all 0.2s ease-in-out;
background-color: var(--nu10);
border: 1px solid var(--border-light);
}


.glossary-term__card-title {
font-size: 1.5rem;
margin-bottom: 0;
margin-bottom: .5rem;
font-weight: bold;
display: flex;
gap: 0.5rem;
Expand All @@ -30,7 +30,7 @@
}

.glossary-term__card:hover {
background-color: #eeeef7;
background-color: #fafafa;
transform: translateY(-.25rem) scale(1.02);
}

Expand All @@ -44,7 +44,6 @@
background-position: 0 0;
display: inline;
transition: .2s ease-in;
padding-left: 1.5rem;

}

Expand All @@ -57,8 +56,6 @@
align-items: center;
gap: 0.325rem;
width: fit-content;
padding-left: 1.5rem;

}

.glossary-term__card-link:hover .arrow-icon {
Expand Down
14 changes: 6 additions & 8 deletions src/components/GlossarySearch/GlossaryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ import React from 'react';
import { GlossaryTermType } from './index';
import './GlossaryCard.css';
import ArrowIcon from '../icons/ArrowIcon';
import BookIcon from '../icons/BookIcon';

const GlossaryTerm = ({ term }: { term: GlossaryTermType }) => (
<div className="glossary-term__card">
<div className="glossary-term__card-header">
<h2 className="glossary-term__card-title">
<BookIcon />
{term.termTitle}
</h2>
</div>
<div>
<div className="glossary-term__card-header">
<h2 className="glossary-term__card-title">{term.termTitle}</h2>
</div>

<div className="glossary-term__card-description">{term.definition}</div>
<div className="glossary-term__card-description">{term.definition}</div>
</div>

{term.slug && (
<a
Expand Down
17 changes: 11 additions & 6 deletions src/components/GlossaryTermPage/GlossaryTermPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

.glossary-term__page-container {
display: grid;
grid-template-columns: 3fr 1fr;
grid-template-columns: 2fr 1fr;
}

.glossary-term__article {
Expand All @@ -15,15 +15,14 @@
.glossary-term__content {
display: flex;
flex-direction: column;
gap: 2rem;
gap: 1rem;
padding: 0 4rem 4rem 0;
}

.glossary-term__aside {
display: flex;
flex-direction: column;
padding: 1.5rem;
background-color: var(--nu10);
padding: 1rem;
border: 1px solid var(--border-light);
border-radius: 8px;
height: fit-content;
Expand All @@ -33,19 +32,25 @@
display: flex;
align-items: baseline;
gap: 0.5rem;
margin-bottom: 0;
}

.glossary-term__definition {
margin: .4rem 0
}


@media (max-width: 1080px) {
.glossary-term__page {
.glossary-term__page-container {
grid-template-columns: 1fr;
}
.glossary-term__content {
padding: 1.5rem;
padding: 0 1.5rem 1.5rem 1.5rem;
}
.glossary-term__aside {
order: -1;
margin: 0;
padding-left: 1.5rem;
}
.glossary-term__content,
.glossary-term__aside {
Expand Down
8 changes: 2 additions & 6 deletions src/components/GlossaryTermPage/GlossaryTermPageAside.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import React from 'react';
import { GlossaryTermType } from '../GlossarySearch';
import BookIcon from '../icons/BookIcon';

const GlossaryTermPageAside = ({ term }: { term: GlossaryTermType }) => (
<aside className="glossary-term__aside">
<h3 className="glossary-term__header">
<BookIcon />
Definition
</h3>
<p>{term.definition}</p>
<h3 className="glossary-term__header">{term.termTitle}</h3>
<span className="glossary-term__definition">{term.definition}</span>
</aside>
);

Expand Down

0 comments on commit 2b5c38d

Please sign in to comment.