Skip to content

Commit

Permalink
remove unused classNames, add native to data-attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchristina committed Oct 25, 2024
1 parent 91166fb commit f1f0128
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions panda.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ export default defineConfig({
safari: '[data-browser=safari] &',
mobile: '[data-device=mobile] &',
desktop: '[data-device=desktop] &',
native: '[data-native=true] &',
android: '[data-platform=android] &',
mac: '[data-platform=mac] &',
iphone: '[data-platform=iphone] &',
Expand Down
5 changes: 1 addition & 4 deletions src/components/AppComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ const AppComponent: FC = () => {
document.body.classList[dark ? 'add' : 'remove']('dark')
document.body.setAttribute('data-color-mode', dark ? 'dark' : 'light')
document.body.setAttribute('data-device', isTouch ? 'mobile' : 'desktop')
document.body.setAttribute('data-native', Capacitor.isNativePlatform() ? 'true' : 'false')
document.body.setAttribute('data-platform', isAndroid ? 'android' : isMac ? 'mac' : isiPhone ? 'iphone' : 'other')
document.body.setAttribute(
'data-browser',
Expand Down Expand Up @@ -175,11 +176,7 @@ const AppComponent: FC = () => {
const componentClassNames = classNames({
// mobile safari must be detected because empty and full bullet points in Helvetica Neue have different margins
mobile: isTouch,
android: isAndroid,
native: Capacitor.isNativePlatform(),
'drag-in-progress': dragInProgress,
chrome: /Chrome/.test(navigator.userAgent),
safari: isSafari(),
})

if (showModal && !modals[showModal]) {
Expand Down

0 comments on commit f1f0128

Please sign in to comment.