Skip to content

Commit

Permalink
refactor: move global styles to specific components (#34)
Browse files Browse the repository at this point in the history
Co-authored-by: Manuel Odelain <[email protected]>
  • Loading branch information
manuelodelain and manuelodelain authored Jul 10, 2024
1 parent 66e14e9 commit e50d87c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 25 deletions.
21 changes: 0 additions & 21 deletions assets/scss/_normalize.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,6 @@
box-sizing: border-box;
}

/* Remove list styles (bullets/numbers) */
ol, ul, menu, summary {
list-style: none;
}

/* For images to not be able to exceed their container */
img {
max-block-size: 100%;
max-inline-size: 100%;
}

/* Safari - solving issue when using user-select:none on the <body> text input doesn't working */
input, textarea {
user-select: auto;
}

/* revert the 'white-space' property for textarea elements on Safari */
textarea {
white-space: revert;
}

/* revert for bug in Chromium browsers
- fix for the content editable attribute will work properly.
- webkit-user-select: auto; added for Safari in case of using user-select:none on wrapper element */
Expand Down
12 changes: 8 additions & 4 deletions components/atoms/VMarkdown/VMarkdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ export default defineComponent({
}
}
ol, ul, menu, summary {
list-style: none;
}
ol {
counter-reset: item;
}
li {
position: relative;
padding: rem(8) 0 rem(8) rem(40);
Expand Down Expand Up @@ -196,10 +204,6 @@ export default defineComponent({
}
}
ol {
counter-reset: item;
}
ol li {
counter-increment: item;
Expand Down
1 change: 1 addition & 0 deletions components/molecules/VInput/VInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const slotName = computed(() => (isCheckbox.value || isRadio.value ? 'beforeLabe
border: none;
grid-column: 1/-1;
grid-row: 1;
user-select: auto; // Safari - solving issue when using user-select:none on the <body> text input doesn't working
&[type='radio'],
&[type='checkbox'] {
Expand Down
2 changes: 2 additions & 0 deletions components/molecules/VTextarea/VTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const { isFocused, isFilled, model, onBlur, onFocus } = useTextInput(props, emit
<style lang="scss" module>
.textarea {
min-height: rem(150);
user-select: auto; // Safari - solving issue when using user-select:none on the <body> text input doesn't working
white-space: revert; // Revert the 'white-space' property for textarea elements on Safari
&:focus,
&:focus-visible {
Expand Down

0 comments on commit e50d87c

Please sign in to comment.