Skip to content

Commit

Permalink
V1C-58: optimize mobile styles (#92)
Browse files Browse the repository at this point in the history
* style(mobile): optimize mobile styles for better proportions and use of screen real-estate
---------

Co-authored-by: Nick Hellemans <[email protected]>
  • Loading branch information
nckhell and Nick Hellemans authored Aug 3, 2023
1 parent 5869017 commit f0e6d77
Show file tree
Hide file tree
Showing 19 changed files with 462 additions and 102 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@awell_health/ui-library",
"version": "0.1.21",
"version": "0.1.22",
"private": false,
"description": "UI components to integrate with Awell Health",
"repository": {
Expand Down
8 changes: 3 additions & 5 deletions src/atoms/button/button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,12 @@
cursor: pointer;
text-decoration: none;
box-shadow: var(--awell-shadow-sm);
padding: var(--awell-spacing-3) var(--awell-spacing-6);
font-size: var(--awell-font-size-base);
padding: var(--awell-spacing-2) var(--awell-spacing-4);
font-size: var(--awell-font-size-sm);
line-height: var(--awell-leading-6);

@media (min-width: 600px) {
padding: var(--awell-spacing-2) var(--awell-spacing-4);
@media (min-width: 640px) {
font-size: var(--awell-font-size-base);
line-height: var(--awell-leading-6);
}

/**
Expand Down
32 changes: 22 additions & 10 deletions src/atoms/checkboxButton/checkboxButton.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
align-items: center;
height: 1.25rem;

input[type="checkbox"] {
input[type='checkbox'] {
height: var(--awell-radio-checkbox-height-mobile);
width: var(--awell-radio-checkbox-width-mobile);
color: var(--awell-accent-color);
border-radius: var(--awell-checkbox-border-radius);
border: 1px solid var(--awell-radio-checkbox-border-color);
margin: 0;
position: relative;
top: 3px;

@media (min-width: 600px) {
@media (min-width: 640px) {
top: 3px;
height: var(--awell-radio-checkbox-height-above-mobile);
width: var(--awell-radio-checkbox-width-above-mobile);
}
Expand All @@ -30,24 +30,36 @@
--awell-ring-color: var(--awell-accent-ring-color-inputs);
--awell-ring-offset-color: #fff;
--awell-ring-offset-width: 2px;
--awell-ring-offset-shadow: 0 0 0 var(--awell-ring-offset-width) var(--awell-ring-offset-color);
--awell-ring-shadow: 0 0 0 calc(2px + var(--awell-ring-offset-width)) var(--awell-ring-color);
--awell-ring-offset-shadow: 0 0 0 var(--awell-ring-offset-width)
var(--awell-ring-offset-color);
--awell-ring-shadow: 0 0 0 calc(2px + var(--awell-ring-offset-width))
var(--awell-ring-color);
--awell-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);

outline: 2px solid transparent;
outline-offset: 2px;
box-shadow: var(--awell-ring-offset-shadow),var(--awell-ring-shadow),var(--awell-shadow,0 0 #0000);
box-shadow: var(--awell-ring-offset-shadow), var(--awell-ring-shadow),
var(--awell-shadow, 0 0 #0000);
}

&:checked, &:checked:focus, &:checked:hover, &:checked:focus, &:checked:hover {
&:checked,
&:checked:focus,
&:checked:hover,
&:checked:focus,
&:checked:hover {
border-color: transparent;
}
}
}

.label_wrapper {
margin-left: var(--awell-spacing-4);
font-size: var(--awell-font-size-lg);
color: var(--awell-radio-checkbox-label-color);
line-height: var(--awell-leading-7)
}
font-size: var(--awell-font-size-base);
line-height: var(--awell-leading-5);

@media (min-width: 640px) {
font-size: var(--awell-font-size-lg);
line-height: var(--awell-leading-7);
}
}
10 changes: 8 additions & 2 deletions src/atoms/logo/logo.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
@use '../../globalStyles';

.awell_logo {
max-width: 150px;
width: auto;
height: auto;
}
max-width: 150px;
max-height: 35px;

@media (min-width: 640px) {
max-height: 75px;
}
}
33 changes: 25 additions & 8 deletions src/atoms/messageAttachment/messageAttachment.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,31 @@
justify-content: space-between;
width: 100%;
height: 100%;
transition: all .3s ease-in-out;
padding: var(--awell-spacing-3) var(--awell-spacing-2);
transition: all 0.3s ease-in-out;
padding: var(--awell-spacing-2) var(--awell-spacing-1);

@media (min-width: 640px) {
padding: var(--awell-spacing-3) var(--awell-spacing-2);
}

&:not(:last-of-type) {
border-bottom: 1px solid var(--awell-slate300);
}
&:hover {
transition: all .3s ease-in-out;
};
transition: all 0.3s ease-in-out;
}

& .awell_message_link_button {
padding: var(--awell-spacing-2) var(--awell-spacing-4);
padding: var(--awell-spacing-1) var(--awell-spacing-2);
color: var(--awell-accent-color);
border-radius: 4px;
text-decoration: none;
font-size: var(--awell-font-size-base);
font-size: var(--awell-font-size-sm);

@media (min-width: 640px) {
padding: var(--awell-spacing-2) var(--awell-spacing-4);
font-size: var(--awell-font-size-base);
}

&:hover {
text-decoration: underline;
Expand All @@ -31,11 +40,19 @@
& .awell_message_name_container {
display: flex;
align-items: center;
font-size: var(--awell-font-size-base);
color: var(--awell-slate800);
font-size: var(--awell-font-size-sm);

@media (min-width: 640px) {
font-size: var(--awell-font-size-base);
}

& img {
margin-right: var(--awell-spacing-4);
margin-right: var(--awell-spacing-2);

@media (min-width: 640px) {
margin-right: var(--awell-spacing-4);
}
}
}
}
42 changes: 23 additions & 19 deletions src/atoms/progressIndicator/progressIndicator.module.scss
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
@use '../../globalStyles';

.progressBar {
--awell-progress-bar-background: var(--awell-secondary-color);
--awell-progress-bar-completed-bar-color: var(--awell-accent-color);
--awell-progress-bar-completed-text-color: var(--awell-accent-text-color);
--awell-progress-bar-background: var(--awell-secondary-color);
--awell-progress-bar-completed-bar-color: var(--awell-accent-color);
--awell-progress-bar-completed-text-color: var(--awell-accent-text-color);
--awell-progress-bar-height: 6px;
background-color: var(--awell-progress-bar-background);
border-radius: 30px;
width: 100%;
height: var(--awell-progress-bar-height);

@media (min-width: 640px) {
--awell-progress-bar-height: 8px;
background-color: var(--awell-progress-bar-background);
}

.progressBar_completed {
border-radius: 30px;
width: 100%;
width: var(--awell-progress-bar-width);
transition: width ease-in-out 0.5s;
will-change: width;
background-color: var(--awell-progress-bar-completed-bar-color);
color: var(--awell-progress-bar-completed-text-color);
line-height: var(--awell-progress-bar-height);
font-weight: var(--awell-font-medium);
font-size: var(--awell-font-size-xs);
text-align: center;
height: var(--awell-progress-bar-height);

.progressBar_completed {
border-radius: 30px;
width: var(--awell-progress-bar-width);
transition: width ease-in-out 0.5s;
will-change: width;
background-color: var(--awell-progress-bar-completed-bar-color);
color: var(--awell-progress-bar-completed-text-color);
line-height: var(--awell-progress-bar-height);
font-weight: var(--awell-font-medium);
font-size: var(--awell-font-size-xs);
text-align: center;
height: var(--awell-progress-bar-height);
}
}
}
13 changes: 9 additions & 4 deletions src/atoms/questionLabel/questionLabel.module.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
.label {
margin-bottom: var(--awell-spacing-1);
font-size: var(--awell-font-size-lg);
margin-bottom: var(--awell-spacing-1\.5);
font-size: var(--awell-font-size-base);
line-height: var(--awell-leading-normal);
font-weight: var(--awell-font-medium);
color: rgb(55 65 81);
display: block;
line-height: var(--awell-leading-relaxed);
// respect newline characters
white-space: pre-wrap;

@media (min-width: 640px) {
font-size: var(--awell-font-size-lg);
line-height: var(--awell-leading-relaxed);
}
}

.asterix {
color: var(--awell-red);
}
}
13 changes: 9 additions & 4 deletions src/atoms/radioButton/radioButton.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
border: 1px solid var(--awell-radio-checkbox-border-color);
margin: 0;
position: relative;
top: 3px;

@media (min-width: 600px) {
@media (min-width: 640px) {
top: 3px;
height: var(--awell-radio-checkbox-height-above-mobile);
width: var(--awell-radio-checkbox-width-above-mobile);
}
Expand Down Expand Up @@ -52,7 +52,12 @@

.label_wrapper {
margin-left: var(--awell-spacing-4);
font-size: var(--awell-font-size-lg);
color: var(--awell-radio-checkbox-label-color);
line-height: var(--awell-leading-7)
font-size: var(--awell-font-size-base);
line-height: var(--awell-leading-5);

@media (min-width: 640px) {
font-size: var(--awell-font-size-lg);
line-height: var(--awell-leading-7);
}
}
34 changes: 20 additions & 14 deletions src/atoms/richTextViewer/richTextViewer.module.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
.content {
font: var(--awell-font);
color: var(--awell-slate600);
font-size: var(--awell-font-size-lg);
font-size: var(--awell-font-size-base);
width: 100%;

@media (min-width: 640px) {
font-size: var(--awell-font-size-lg);
}

h1,
h2,
h3,
Expand All @@ -15,34 +19,36 @@
}

h1 {
font-size: var(--awell-font-size-3xl);
font-size: var(--awell-font-size-2xl);

@media (min-width: 600px) {
font-size: var(--awell-font-size-2xl);
@media (min-width: 640px) {
font-size: var(--awell-font-size-3xl);
}
}

h2 {
font-size: var(--awell-font-size-2xl);
font-size: var(--awell-font-size-xl);

@media (min-width: 600px) {
font-size: var(--awell-font-size-xl);
@media (min-width: 640px) {
font-size: var(--awell-font-size-2xl);
}
}

h3 {
font-size: var(--awell-font-size-xl);
font-size: var(--awell-font-size-lg);

@media (min-width: 600px) {
font-size: var(--awell-font-size-lg);
@media (min-width: 640px) {
font-size: var(--awell-font-size-xl);
}
}

h4 {
font-size: var(--awell-font-size-lg);
font-size: var(--awell-font-size-base);
font-weight: var(--awell-font-semibold);

@media (min-width: 600px) {
font-size: var(--awell-font-size-base);
@media (min-width: 640px) {
font-size: var(--awell-font-size-lg);
font-weight: var(--awell-font-normal);
text-transform: uppercase;
}
}
Expand Down Expand Up @@ -104,7 +110,7 @@
}

figure {
display: inline
display: inline;
}

.bold {
Expand Down
15 changes: 9 additions & 6 deletions src/globalStyles/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
html {

/*
FONT
*/
Expand All @@ -9,6 +8,7 @@ html {
Misc
*/
--awell-header-height: 94px;
--awell-mobile-footer-height: 60px;
--awell-footer-height: 80px;

/*
Expand Down Expand Up @@ -118,7 +118,7 @@ html {
/* 240px */

--awell-spacing-none: var(--spacing-none);
--awell-spacing-O\.5: var(--spacing-O\.5);
--awell-spacing-0\.5: var(--spacing-O\.5);
--awell-spacing-1: var(--spacing-1);
--awell-spacing-1\.5: var(--spacing-1\.5);
--awell-spacing-2: var(--spacing-2);
Expand Down Expand Up @@ -176,9 +176,12 @@ html {
*/
--awell-shadow-none: 0 0 #0000;
--awell-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
--awell-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
--awell-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
--awell-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
--awell-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1),
0 2px 4px -2px rgb(0 0 0 / 0.1);
--awell-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
0 4px 6px -4px rgb(0 0 0 / 0.1);
--awell-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1),
0 8px 10px -6px rgb(0 0 0 / 0.1);
--awell-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

/*
Expand All @@ -199,7 +202,7 @@ html {
LINE-HEIGHT
Based on https://tailwindcss.com/docs/line-height#relative-line-heights
*/
--awell-leading-3: .75rem;
--awell-leading-3: 0.75rem;
/* 12px */
--awell-leading-4: 1rem;
/* 16px */
Expand Down
Loading

0 comments on commit f0e6d77

Please sign in to comment.