Skip to content

Commit

Permalink
feat: mac specific os styling
Browse files Browse the repository at this point in the history
  • Loading branch information
helloanoop committed Aug 6, 2024
1 parent 911e3aa commit eb1c10f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
8 changes: 8 additions & 0 deletions packages/bruno-app/src/providers/App/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useEffect } from 'react';
import { get } from 'lodash';
import { useDispatch } from 'react-redux';
import { refreshScreenWidth } from 'providers/ReduxStore/slices/app';
import ConfirmAppClose from './ConfirmAppClose';
Expand All @@ -18,6 +19,13 @@ export const AppProvider = (props) => {
dispatch(refreshScreenWidth());
}, []);

useEffect(() => {
const platform = get(navigator, 'platform', '');
if(platform && platform.toLowerCase().indexOf('mac') > -1) {
document.body.classList.add('os-mac');
}
}, []);

useEffect(() => {
const handleResize = () => {
dispatch(refreshScreenWidth());
Expand Down
9 changes: 6 additions & 3 deletions packages/bruno-app/src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ body::-webkit-scrollbar-thumb,
border-radius: 5rem;
}

* {
/* This ensures that scrollbars are only visible when the user starts to scroll,
providing a cleaner and more minimalistic appearance. */
/*
* Mac-specific scrollbar styling
* This ensures that scrollbars are only visible when the user starts to scroll,
* providing a cleaner and more minimalistic appearance.
*/
body.os-mac * {
scrollbar-width: thin;
}

Expand Down

0 comments on commit eb1c10f

Please sign in to comment.