Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
inokawa committed Jan 10, 2024
1 parent 334e83f commit bf1f13b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { computeStyle, once } from "./utils";
*/
export const isBrowser = typeof window !== "undefined";

const getDocumentRoot = () => document.documentElement;
const getDocumentElement = () => document.documentElement;

/**
* The scroll position may be negative value in rtl direction.
Expand Down Expand Up @@ -35,7 +35,7 @@ export const hasNegativeOffsetInRTL = /*#__PURE__*/ once(
export const isRTLDocument = /*#__PURE__*/ once((): boolean => {
// TODO support SSR in rtl
return isBrowser
? computeStyle(getDocumentRoot()).direction === "rtl"
? computeStyle(getDocumentElement()).direction === "rtl"
: false;
});

Expand All @@ -51,5 +51,5 @@ export const isIOSWebKit = /*#__PURE__*/ once((): boolean => {
* @internal
*/
export const isSmoothScrollSupported = /*#__PURE__*/ once((): boolean => {
return "scrollBehavior" in getDocumentRoot().style;
return "scrollBehavior" in getDocumentElement().style;
});

0 comments on commit bf1f13b

Please sign in to comment.