Skip to content

Commit

Permalink
Mobile CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
kepano committed Sep 24, 2024
1 parent 317a0fb commit fc366a0
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 18 deletions.
9 changes: 2 additions & 7 deletions src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@ html {
font-size: 16px;
}

.is-mobile-safari {
font-size: 18px;
}
.is-firefox-mobile {
font-size: 20px;
}

body {
padding: 0;
margin: 0;
Expand All @@ -25,6 +18,8 @@ body {
font-size: var(--font-ui-medium);
}

@import 'styles/mobile';

@import 'styles/buttons';
@import 'styles/dragging';
@import 'styles/dropdowns';
Expand Down
6 changes: 6 additions & 0 deletions src/styles/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
:root {
--safe-area-inset-top: env(safe-area-inset-top);
--safe-area-inset-bottom: env(safe-area-inset-bottom);
--safe-area-inset-left: env(safe-area-inset-left);
--safe-area-inset-right: env(safe-area-inset-right);

--accent-h: 258;
--accent-s: 88%;
--accent-l: 66%;
Expand All @@ -24,6 +29,7 @@
--interactive-accent: var(--color-accent-1);
--interactive-accent-hover: var(--color-accent-2);

--icon-size: 1rem;
--input-height: 1.875rem;

--radius-s: 4px;
Expand Down
4 changes: 2 additions & 2 deletions src/styles/buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ button {

.clickable-icon,
button.clickable-icon {
width: 28px;
height: 28px;
width: 1.75rem;
height: 1.75rem;
display: flex;
padding: 0px 4px;
background-color: transparent;
Expand Down
10 changes: 5 additions & 5 deletions src/styles/icons.scss
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
svg.lucide-icon {
stroke-width: 1.75px;
width: 16px;
height: 16px;
width: var(--icon-size);
height: var(--icon-size);
}
.metadata-property-icon {
margin-inline-start: 4px;
display: flex;
align-items: center;
justify-content: center;
min-width: 16px;
min-width: var(--icon-size);
color: var(--text-muted);
svg {
width: 16px;
height: 16px;
width: var(--icon-size);
height: var(--icon-size);
}
}
25 changes: 25 additions & 0 deletions src/styles/mobile.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.is-mobile-safari {
font-size: 18px;
}
.is-firefox-mobile {
font-size: 20px;
}

.is-mobile-safari,
.is-firefox-mobile {
height: 100%;
--icon-size: 1rem;
--input-shadow: none;
--input-shadow-hover: none;

button {
--input-height: 2.5rem;
border-radius: 2rem;
border: 0;
box-shadow: none;
}

a, button, label, input, textarea, select {
-webkit-tap-highlight-color: transparent;
}
}
6 changes: 3 additions & 3 deletions src/styles/popup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
display: flex;
flex-direction: row;
padding-top: 4px;
align-items: center;
}

#template-container {
Expand Down Expand Up @@ -266,16 +267,15 @@
#popup-actions {
padding-right: 4px;
z-index: 100;
align-self: flex-end;
justify-self: flex-end;
align-items: center;
margin-left: auto;
user-select: none;
-webkit-user-select: none;
background-color: var(--background-primary);
display: flex;
flex-direction: row;
gap: 2px;
.clickable-icon {
width: 24px;
border-radius: var(--radius-s);
user-select: none;
-webkit-user-select: none;
Expand Down
18 changes: 17 additions & 1 deletion src/styles/settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,22 @@
}
}

:root {
--settings-section-height-mobile: calc(100vh - var(--safe-area-inset-bottom) - 48px);
}

@supports (height: 100dvh) {
.is-mobile-safari {
--settings-section-height-mobile: calc(100dvh - 48px);
}
}

@media (max-width: 768px) {
#settings {
#settings-container {
min-height: 100vh;
overflow: hidden;
}
#navbar {
padding: 0 24px;
width: 100%;
Expand All @@ -338,10 +352,12 @@
}
.settings-section {
margin: 0;
padding: 24px;
padding: 24px 24px 48px;
height: var(--settings-section-height-mobile);
overflow: scroll;
-webkit-overflow-scrolling: touch;
}

#content {
display: flex;
flex-direction: column;
Expand Down

0 comments on commit fc366a0

Please sign in to comment.