Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

Use relative CSS units (#484)

Guillermo Peralta Scura1a03a29025e6
diff --git a/src/components/ColorPicker.css b/src/components/ColorPicker.css
index e2920fe851..00069de9c9 100644
--- a/src/components/ColorPicker.css
+++ b/src/components/ColorPicker.css
@@ -35,7 +35,7 @@
}
.color-picker-content {
- padding: 15px 9px 9px 15px;
+ padding: 1rem 0.5rem 0.5rem 1rem;
}
.colors-gallery {
@@ -45,12 +45,12 @@
.color-picker-swatch {
position: relative;
- height: 30px;
- width: 30px;
+ height: 1.875rem;
+ width: 1.875rem;
cursor: pointer;
outline: none;
border-radius: 4px;
- margin: 0px 6px 6px 0px;
+ margin: 0px 0.375rem 0.375rem 0px;
box-sizing: border-box;
border: 1px solid #ddd;
}
@@ -75,8 +75,8 @@
.color-picker-hash {
background: #dee2e6;
- height: 30px;
- width: 30px;
+ height: 1.875rem;
+ width: 1.875rem;
border-radius: 4px 0px 0px 4px;
color: #495057;
display: flex;
@@ -89,33 +89,33 @@
}
.color-picker-input {
- width: 100px;
- font-size: 14px;
+ width: 6.25em;
+ font-size: 1rem;
color: #343a40;
border: 0px;
outline: none;
- height: 28px;
+ height: 1.75em;
box-shadow: #dee2e6 0px 0px 0px 1px inset;
box-sizing: content-box;
border-radius: 0px 4px 4px 0px;
float: left;
- padding-left: 8px;
+ padding-left: 0.5em;
text-transform: lowercase;
}
.color-picker-label-swatch {
- height: 30px;
- width: 30px;
- margin-right: 4px;
+ height: 1.875rem;
+ width: 1.875rem;
+ margin-right: 0.25rem;
border: 1px solid #dee2e6;
}
.color-picker-swatch-input {
- font-size: 16px;
+ font-size: 1rem;
display: inline-block;
- width: 100px;
+ width: 6.25rem;
border-radius: 2px;
- padding: 2px 4px;
+ padding: 0.125em 0.25em;
border: 1px solid #dee2e6;
text-transform: lowercase;
}
diff --git a/src/components/ContextMenu.css b/src/components/ContextMenu.css
index 992e3cc257..3b91d2f6e9 100644
--- a/src/components/ContextMenu.css
+++ b/src/components/ContextMenu.css
@@ -5,14 +5,14 @@
padding: 0;
list-style: none;
user-select: none;
- margin: -4px 0 0 1px;
- padding: 4px 0;
+ margin: -0.25rem 0 0 0.125rem;
+ padding: 0.25rem 0;
background-color: #f2f2f2;
border: 1px solid #bcbcbc;
}
.context-menu__option {
- width: 150px;
+ width: 9.5rem;
}
.context-menu-option {
@@ -21,7 +21,7 @@
margin: 0;
text-align: left;
border-radius: 0;
- padding-left: 20px;
+ padding-left: 1.25rem;
background-color: #f2f2f2;
border: none;
}
diff --git a/src/components/EditableText.css b/src/components/EditableText.css
index 2a5f71ef9b..43a404bea9 100644
--- a/src/components/EditableText.css
+++ b/src/components/EditableText.css
@@ -2,8 +2,8 @@
display: inline-block;
cursor: pointer;
border: none;
- padding: 4px;
- margin: -4px;
+ padding: 0.25rem;
+ margin: -0.25rem;
white-space: nowrap;
border-radius: var(--space-factor);
}
diff --git a/src/components/ExportDialog.css b/src/components/ExportDialog.css
index 460f70f809..547298fa82 100644
--- a/src/components/ExportDialog.css
+++ b/src/components/ExportDialog.css
@@ -35,7 +35,7 @@
.ExportDialog__preview canvas {
max-width: calc(100% - var(--preview-padding) * 2);
- max-height: 400px;
+ max-height: 25rem;
}
.ExportDialog__actions {
diff --git a/src/components/FixedSideContainer.css b/src/components/FixedSideContainer.css
index e6247189c9..8eedd402fb 100644
--- a/src/components/FixedSideContainer.css
+++ b/src/components/FixedSideContainer.css
@@ -1,5 +1,5 @@
.FixedSideContainer {
- --margin: 5px;
+ --margin: 0.25rem;
position: fixed;
pointer-events: none;
}
diff --git a/src/components/ToolIcon.scss b/src/components/ToolIcon.scss
index f5225c4a36..bd25d91d9d 100644
--- a/src/components/ToolIcon.scss
+++ b/src/components/ToolIcon.scss
@@ -6,8 +6,8 @@
.ToolIcon__icon {
background-color: #e9ecef;
- width: 41px;
- height: 41px;
+ width: 2.5rem;
+ height: 2.5rem;
display: flex;
justify-content: center;
@@ -21,8 +21,8 @@
}
.ToolIcon_size_s .ToolIcon__icon {
- width: 25px;
- height: 25px;
+ width: 1.4rem;
+ height: 1.4rem;
font-size: 0.8em;
}
diff --git a/src/styles.scss b/src/styles.scss
index bfb3637b61..decfaa88e6 100644
--- a/src/styles.scss
+++ b/src/styles.scss
@@ -34,9 +34,9 @@ body {
flex-direction: column;
h5 {
- margin-top: 4px;
- margin-bottom: 4px;
- font-size: 12px;
+ margin-top: 0.333rem;
+ margin-bottom: 0.333em;
+ font-size: 0.75rem;
color: var(--text-color-primary);
}
@@ -48,7 +48,8 @@ body {
flex-wrap: wrap;
button {
- margin-right: 4px;
+ margin-right: 0.25rem;
+ font-size: 0.75rem;
}
}
}
@@ -68,8 +69,8 @@ button {
background-color: #e9ecef;
border: 0;
border-radius: 4px;
- margin: 2px 0;
- padding: 5px;
+ margin: 0.125rem 0;
+ padding: 0.25rem;
outline: transparent;
&:focus {
@@ -130,5 +131,5 @@ button {
}
.App-right-menu {
- width: 220px;
+ width: 13.75rem;
}
diff --git a/src/theme.css b/src/theme.css
index be5a040479..8e8107ee29 100644
--- a/src/theme.css
+++ b/src/theme.css
@@ -3,5 +3,5 @@
--bg-color-main: #fff;
--shadow-island: 0 1px 5px rgba(0, 0, 0, 0.15);
--border-radius-m: 4px;
- --space-factor: 4px;
+ --space-factor: 0.25rem;
}