Skip to content

Commit

Permalink
fix(style): better mobile support
Browse files Browse the repository at this point in the history
  • Loading branch information
AugustinMauroy committed Sep 8, 2023
1 parent 909bc9b commit 5127ec5
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/app/[lang]/blog/page.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@
justify-content: flex-start;
align-items: stretch;
gap: 1rem;

@media (max-width: 768px) {
flex-direction: column;
justify-content: center;
align-items: center;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.copyButton {
background-color: var(--green5);
border-radius: 0.5rem;
color: var(--text-color);
color: var(--white);
cursor: pointer;
border: none;
font-size: 1rem;
Expand Down
9 changes: 9 additions & 0 deletions src/components/article/codeBox/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
justify-content: space-between;
align-items: center;
padding: 0.5rem 1rem;

.label::after {
content: '';
display: block;
width: 100%;
height: 2px;
background-color: var(--green6);
margin-top: 0.05rem;
}
}
.code {
border-radius: 0 0 5px 5px !important;
Expand Down
4 changes: 3 additions & 1 deletion src/components/article/codeBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export const replaceLanguages = (language: string) =>
const CodeBox: FC<CodeBoxProps> = ({ codeData }) => (
<div className={styles.codeBox}>
<div className={styles.codeLabel}>
<strong>{replaceLabelLanguages(codeData.props.className)}</strong>
<strong className={styles.label}>
{replaceLabelLanguages(codeData.props.className)}
</strong>
<CopyButton code={codeData.props.children} />
</div>
<Code
Expand Down
3 changes: 1 addition & 2 deletions src/components/common/dropDown/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
width: fit-content;
max-width: 200px;
background-color: var(--app-fill);
Expand All @@ -33,7 +32,7 @@

.open {
opacity: 1;
transform: translateX(-50%) translateY(0);
transform: translateX(-50%) translateY(10px);
}

.dropdownItem {
Expand Down
16 changes: 16 additions & 0 deletions src/components/projects/card/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
img {
border-radius: 10px 0 0 10px;
border-right: 1px solid var(--text-color);
width: 50%;
height: auto;
}

.content {
Expand All @@ -20,4 +22,18 @@
text-align: left;
width: 100%;
}

@media (max-width: 768px) {
flex-direction: column;
height: auto;

img {
display: none;
}

.content {
text-align: center;
padding-bottom: 1rem;
}
}
}
6 changes: 6 additions & 0 deletions src/components/sections/header/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,10 @@
height: 22px;
}
}

@media (max-width: 768px) {
flex-direction: column;
align-items: center;
justify-content: center;
}
}
1 change: 1 addition & 0 deletions src/styles/globals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ html {
--black-main: var(--black6);
--green_main: var(--green6);
--yellow_main: var(--yellow6);
--white: var(--black0);

&[data-theme='dark'] {
--app-fill: var(--black8);
Expand Down

0 comments on commit 5127ec5

Please sign in to comment.