Skip to content

Commit

Permalink
fix: mobile layout shifts
Browse files Browse the repository at this point in the history
  • Loading branch information
maybeanerd committed Sep 11, 2023
1 parent 5e42204 commit ec5b2f7
Showing 1 changed file with 53 additions and 1 deletion.
54 changes: 53 additions & 1 deletion layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ colorModePreference.set('system');
const { theme } = tailwindConfig;
// TODO finalize theme
// TODO somehow disable "mobile theme"
const themeConfig: ThemeConfig = {
shared: {
common: {
Expand All @@ -47,5 +46,58 @@ const themeConfig: ThemeConfig = {
primaryColorPressed: theme.colors.primary.action.dark,
},
},
// We don't want to have a mobile "theme" at all,
// since all it really does is introduce layout shift after loading the page
// might solve this with a feature later as mentioned here https://github.com/becem-gharbi/nuxt-naiveui/issues/21
mobile: {
common: {
fontSize: '14px',
heightMedium: '34px',
fontSizeMedium: '14px',
},
Form: {
labelFontSizeTopMedium: '14px',
},
Input: {
heightMedium: '34px',
fontSizeMedium: '14px',
},
Button: {
heightMedium: '34px',
fontSizeMedium: '14px',
},
Card: {
fontSizeMedium: '14px',
},
Avatar: {
heightMedium: '34px',
fontSize: '14px',
},
ColorPicker: {
heightMedium: '34px',
fontSizeMedium: '14px',
},
Dropdown: {
optionHeightMedium: '34px',
fontSizeMedium: '14px',
},
Radio: {
buttonHeightMedium: '34px',
fontSizeMedium: '14px',
},
Skeleton: {
heightMedium: '34px',
},
Tag: {
heightMedium: '34px',
fontSizeMedium: '14px',
},
Result: {
fontSizeMedium: '14px',
},
Tabs: {
tabFontSizeMedium: '14px',
},
},
};
</script>

0 comments on commit ec5b2f7

Please sign in to comment.