OPEN_GRID API - v1.5.2
    Preparing search index...

    Function applyHeader

    • 머리글 프리셋을 적용한다. 코어 무수정 경로.

      두 경로가 있고, 능력 차이가 타이포 축보다 훨씬 크다. 정직하게 밝힌다.

      1. targetHTMLElement(그리드 컨테이너 = .og-container)이면 data-og-header 속성을 붙인다. header.css 의 프리셋 블록이 전부 살아난다. 이 경로가 완전판이며 open-grid/header.css 로드가 전제다. 값을 인라인하지 않는 이유는 인라인 스타일이 프리셋의 T1(토큰 재정의) 규칙보다 강해 프리셋을 덮어버리기 때문이다.
      2. target그리드 인스턴스이면 공개 setThemeVar() 로 형태 토큰 8개만 인라인 주입한다. OpenGrid 는 컨테이너 요소를 반환하는 공개 접근자를 제공하지 않으므로(_container 는 private) 속성을 붙일 방법이 없다. 헤더 축은 프리셋의 거의 전부가 속성 조건부 셀렉터라 이 경로로는 사실상 아무 변화가 없다 — 타이포 축과 달리 "반쪽" 이 아니라 "거의 무동작" 이다. 그 사실을 경고로 반환한다.

      완전 적용이 필요하면 컨테이너 요소를 직접 넘겨라(document.querySelector('.og-container')).

      Apply a header preset. Requires no core modification.

      There are two paths and the capability gap is much wider than the typography axis's.

      1. An HTMLElement target gets the data-og-header attribute and every CSS preset rule works.
      2. A grid instance target gets only the 8 shape tokens injected inline. Because virtually all preset rules are attribute-conditional, this path produces almost no visible change — this is returned as a warning rather than failing silently.

      Parameters

      • target: HTMLElement | HeaderGridTarget

        그리드 컨테이너 요소 또는 그리드 인스턴스

        The grid container element, or a grid instance

      • id: string

        프리셋 id('default' 는 축 해제 = 오늘의 머리글)

        Preset id ('default' clears the axis)

      Returns HeaderApplyResult

      적용 경로 + 정직 고지

      The path taken plus honest notices

      target 이 요소도 그리드도 아니면 Error

      Throws when the target is neither an element nor a grid

      import { applyHeader } from 'open-grid/header';
      import 'open-grid/header.css';

      applyHeader(document.querySelector('.og-container')!, 'rule'); // 완전 적용
      applyHeader(grid, 'rule'); // 토큰만 — 경고 1건 반환(사실상 무동작)