Socket
Book a DemoInstallSign in
Socket

@imwebme/imds-stylesheet

Package Overview
Dependencies
Maintainers
7
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@imwebme/imds-stylesheet

## 설치

latest
npmnpm
Version
1.0.10
Version published
Weekly downloads
17
1600%
Maintainers
7
Weekly downloads
 
Created
Source

@imwebme/imds-stylesheet

설치

npm install @imwebme/imds-stylesheet
yarn add @imwebme/imds-stylesheet

가이드

주요 렌더링 경로에 배치합니다.

SPA 의 경우 -> index.tsx Next.js의 경우 (page dir) -> _app.tsx Next.js의 경우 (app dir) -> app/layout.tsx

import "@imwebme/imds-stylesheet";

루트 엘리먼트() 초기화

ImDS 에서 제공하는 속성은 사용하기 전에 명시적인 초기화가 필요합니다.

페이지 루트 요소에 data-imds-theme 어트리뷰트를 지정합니다.

예시 (HTML, SPA react)

<html lang="ko" data-imds-theme="light-only">
  <head>
    <meta name="color-scheme" content="light" />
  </head>

  <body>
    <!-- your script -->
  </body>
</html>

예시 (Nextjs > page dir)

<Html lang="ko" data-imds-theme="light-only">
  <Head>
    <meta name="color-scheme" content="light" />
  </Head>

  <body>
    <Main />
    <NextScript />
  </body>
</Html>

예시 (Nextjs > app dir)

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="ko" data-imds-theme="light-only">
      <head>
        <meta name="color-scheme" content="light" />
      </head>

      <body>{children}</body>
    </html>
  );
}

FAQs

Package last updated on 04 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts