Maison > interface Web > tutoriel CSS > le corps du texte

Repenser le CSS dans JS

王林
Libérer: 2024-09-12 16:18:55
original
1138 Les gens l'ont consulté

0. Introduction

Dans le monde du développement Web, CSS est un élément clé pour rendre les interfaces utilisateur belles et fonctionnelles.

Cependant, à mesure que la complexité des applications Web augmente, la gestion CSS est devenue une tâche de plus en plus difficile. Les conflits de style, la dégradation des performances et les difficultés de maintenance préoccupent de nombreux développeurs.

Ces problématiques freinent-elles l'avancée de vos projets ? (source de l'image)

Rethinking CSS in JS

Cet article approfondit les nouvelles approches pour résoudre ces problèmes, en particulier CSS dans JS.
En commençant par le contexte historique du CSS, il couvre un large éventail de sujets depuis les méthodes de style modernes jusqu'aux futurs systèmes de conception.

La structure de l'article est la suivante :

  1. Définition et contexte du CSS en JS
    • 1. Qu'est-ce que CSS en JS ?
    • 2. L'arrière-plan du CSS en JS
  2. Contexte historique du CSS et du design
    • 3. Le contexte du CSS
    • 4. L'arrière-plan du Design
    • 5. L'arrière-plan de Design System
  3. Analyse des méthodes de gestion du style et nouvelles propositions
    • 6. Comment les styles étaient-ils gérés ?
    • 7. Comment gérer les styles ?
  4. Plans d'implémentation spécifiques pour CSS dans JS
    • 8. Pourquoi CSS en JS ?
    • 9. Présenter le projet mincho
    • 10. CSS compatible CSS en JS
    • 11. CSS évolutif en JS
  5. Intégration avec les systèmes de conception
    • 12. CSS en JS pour les systèmes de conception

En particulier, cet article introduit de nouveaux concepts appelés méthodologie SCALE CSS et StyleStack, et propose un projet mincho basé sur ceux-ci. Il vise à implémenter du CSS dans JS qui soit compatible avec CSS et évolutif.

Le but ultime de cet article est de présenter la possibilité de meilleures solutions de style aux développeurs, concepteurs et autres parties prenantes du projet Web.

Maintenant, approfondissons le monde du CSS dans JS dans le texte principal. Ce sera un long voyage, mais j'espère qu'il vous apportera une nouvelle inspiration et des opportunités de défi.

1. Qu'est-ce que CSS dans JS ?

CSS en JS est une technique qui vous permet d'écrire des styles CSS directement dans votre code JavaScript (ou TypeScript).
Au lieu de créer des fichiers CSS séparés, vous pouvez définir des styles aux côtés des composants dans vos fichiers JavaScript.

/** @jsxImportSource @emotion/react */
import { css } from "@emotion/react";

const buttonStyles = (primary) => css({
  backgroundColor: primary ? "blue" : "white",
  color: primary ? "white" : "black",
  fontSize: "1em",
  padding: "0.25em 1em",
  border: "2px solid blue",
  borderRadius: "3px",
  cursor: "pointer",
});

function Button({ primary, children }) {
  return (
    <button css={buttonStyles(primary)}>
      {children}
    </button>
  );
}

function App() {
  return (
    <div>
      <Button>Normal Button</Button>
      <Button primary>Primary Button</Button>
    </div>
  );
}
Copier après la connexion

Pouvoir l'intégrer à JavaScript semble certainement pratique ?

2. L'arrière-plan du CSS dans JS

Le CSS dans JS a été introduit à partir d'une présentation intitulée « React : CSS in JS – NationJS » par Vjeux, un développeur Facebook.

Les problèmes que CSS-in-JS visait à résoudre étaient les suivants :
Rethinking CSS in JS

Quel est le problème plus précisément ?
Et comment CSS dans JS le résout-il ?

Je les ai organisés dans le tableau suivant :

Problem Solution
Global namespace Need unique class names that are not duplicated as all styles are declared globally Use Local values as default
- Creating unique class names
- Dynamic styling
Implicit Dependencies The difficulty of managing dependencies between CSS and JS
- Side effect: CSS is applied globally, so it still works if another file is already using that CSS
- Difficulty in call automation: It's not easy to statically analyze and automate CSS file calls, so developers have to manage them directly
Using the module system of JS
Dead Code Elimination Difficulty in removing unnecessary CSS during the process of adding, changing, or deleting features Utilize the optimization features of the bundler
Minification Dependencies should be identified and reduced As dependencies are identified, it becomes easier
to reduce them.
Sharing Constants Unable to share JS code and state values Use JS values as they are, or utilize CSS Variables
Non-deterministic Resolution Style priority varies depending on the CSS loading order - Specificity is automatically calculated and applied
- Compose and use the final value
Breaking Isolation Difficulty in managing external modifications to CSS (encapsulation) - Encapsulation based on components
- Styling based on state
- Prevent styles that break encapsulation, such as .selector > *

But it's not a silverbullet, and it has its drawbacks.

  1. CSS-in-JS adds runtime overhead.
  2. CSS-in-JS increases your bundle size.
  3. CSS-in-JS clutters the React DevTools.
  4. Frequently inserting CSS rules forces the browser to do a lot of extra work.
  5. With CSS-in-JS, there's a lot more that can go wrong, especially when using SSR and/or component libraries.

Aside from the DevTools issue, it appears to be mostly a performance issue.
Of course, there are CSS in JS, which overcomes these issues by extracting the CSS and making it zero runtime, but there are some tradeoffs.
Here are two examples.

  1. Co‑location: To support co-location while removing as much runtime as possible, the module graph and AST should be analyzed and build times will increase. Alternatively, there is a method of abandoning co-location and isolating on a file-by-file basis, similar to Vanilla Extract.
  2. Dynamic styling restrictions: The combination of build issues and the use of CSS Variables forces us to support only some representations, like Styling based on props in Pigment CSS, or learn to do things differently, like Coming from Emotion or styled-components. Dynamicity is also one of the main metrics that can be used to distinguish between CSS in JS.

Therefore, pursuing zero(or near-zero) runtime in CSS-in-JS implementation methods creates a significant difference in terms of expressiveness and API.

3. The background of CSS

3.1 The Beginning of CSS

Where did CSS come from?
Early web pages were composed only of HTML, with very limited styling options.

<p><font color="red">This text is red.</font></p>
<p>This is <strong>emphasized</strong> text.</p>
<p>This is <em>italicized</em> text.</p>
<p>This is <u>underlined</u> text.</p>
<p>This is <strike>strikethrough</strike> text.</p>
<p>This is <big>big</big> text, and this is <small>small</small> text.</p>
<p>H<sub>2</sub>O is the chemical formula for water.</p>
<p>2<sup>3</sup> is 8.</p>
Copier après la connexion

For example, the font tag could change color and size, but it couldn't adjust letter spacing, line height, margins, and so on.

You might think, "Why not just extend HTML tags?" However, it's difficult to create tags for all styling options, and when changing designs, you'd have to modify the HTML structure itself.
This deviates from HTML's original purpose as a document markup language and also means that it's hard to style dynamically.

If you want to change an underline to a strikethrough at runtime, you'd have to create a strike element, clone the inner elements, and then replace them.

const strikeElement = document.createElement("strike");
strikeElement.innerHTML = uElement.innerHTML;
uElement.parentNode.replaceChild(strikeElement, uElement);
Copier après la connexion

When separated by style, you only need to change the attributes.

element.style.textDecoration = "line-through";
Copier après la connexion

If you convert to inline style, it would be as follows:

<p style="color: red;">This text is red.</p>
<p>This is <span style="font-weight: bold;">bold</span> text.</p>
<p>This is <span style="font-style: italic;">italic</span> text.</p>
<p>This is <span style="text-decoration: underline;">underlined</span> text.</p>
<p>This is <span style="text-decoration: line-through;">strikethrough</span> text.</p>
<p>This is <span style="font-size: larger;">large</span> text, and this is <span style="font-size: smaller;">small</span> text.</p>
<p>H<span style="vertical-align: sub; font-size: smaller;">2</span>O is the chemical formula for water.</p>
<p>2<span style="vertical-align: super; font-size: smaller;">3</span> is 8.</p>
Copier après la connexion

However, inline style must be written repeatedly every time.
That's why CSS, which styles using selectors and declarations, was introduced.

<p>This is the <strong>important part</strong> of this sentence.</p>
<p>Hello! I want to <strong>emphasize this in red</strong></p>
<p>In a new sentence, there is still an <strong>important part</strong>.</p>

<style>
strong { color: red; text-decoration: underline; }
</style>
Copier après la connexion

Since CSS is a method that applies multiple styles collectively, rules are needed to determine which style should take precedence when the target and style of CSS Rulesets overlap.

CSS was created with a feature called Cascade to address this issue. Cascade is a method of layering styles, starting with the simple ones and moving on to the more specific ones later. The idea was that it would be good to create a system where basic styles are first applied to the whole, and then increasingly specific styles are applied, in order to reduce repetitive work.

Therefore, CSS was designed to apply priorities differently according to the inherent specificity of CSS Rules, rather than the order in which they were written.

/* The following four codes produce the same result even if their order is changed. */
#id { color: red; }
.class { color: green; }
h1 { color: blue; }
[href] { color: yellow; }

/* Even if the order is changed, the result is the same as the above code. */
h1 { color: blue; }
#id { color: red; }
[href] { color: yellow; }
.class { color: green; }
Copier après la connexion

However, as CSS became more scalable, a problem arose..

3.2 Scalable CSS

Despite the advancements in CSS, issues related to scalability in CSS are still being discussed.
In addition to the issues raised by CSS in JS, several other obstacles exist in CSS.

  1. Code duplication: When writing media queries, pseudo-classes, and pseudo-elements, a lot of duplication occurs if logic is required.
  2. Specificity wars: As a workaround for name collisions and non-deterministic ordering, specificity keeps raising the specificity to override the style. You can have fun reading Specificity Battle!
  3. Lack of type-safety: CSS does not work type-safely with TypeScript or Flow.

These issues can be addressed as follows:

  1. 코드 중복: CSS 전처리기 등에 중첩을 사용하세요.
  2. 특수성 전쟁: Atomic CSS는 각 속성에 대해 별도로 정의되므로 로딩 순서와 !important를 제외하면 동일한 특이성을 갖습니다.
  3. 유형 안전성 부족: 유형 안전성이 지원되는 JS의 CSS를 사용하세요.

레이아웃을 표현하는 것은 CSS의 또 다른 장애물이며, 다양한 속성 간의 상호 작용으로 인해 더욱 복잡해졌습니다.
Rethinking CSS in JS

CSS는 표면적으로 단순해 보일 수 있지만 익히기가 쉽지 않습니다. 단순한 중심 정렬에도 많은 사람들이 어려움을 겪는다는 사실은 잘 알려져 있습니다(1, 2). CSS의 겉보기 단순성은 그 깊이와 뉘앙스로 인해 처음에 보이는 것보다 더 어려워지기 때문에 기만적일 수 있습니다.

예를 들어 CSS의 디스플레이에는 블록, 인라인, 테이블, 플렉스, 그리드 등 다양한 레이아웃 모델이 있습니다.
상자 모델, 반응형 디자인, 부동 소수점, 위치 지정, 변환, 쓰기 모드, 마스크 등의 속성을 조합하여 사용할 때의 복잡성을 상상해 보십시오.

프로젝트 규모가 커질수록 DOM 포지셔닝, 캐스케이딩, 특이성과 관련된 부작용으로 인해 더욱 어려워집니다.

레이아웃 문제는 잘 디자인된 CSS 프레임워크를 통해 해결해야 하며, 앞서 언급한 것처럼 JS에서 CSS를 사용하여 스타일을 분리하면 부작용을 완화할 수 있습니다.

그러나 이 접근 방식이 모든 문제를 완전히 해결하는 것은 아닙니다. 스타일 분리는 각 구성 요소의 중복 스타일 선언으로 인해 파일 크기가 커지거나 애플리케이션 전체에서 공통 스타일의 일관성을 유지하기가 어렵다는 등의 새로운 부작용을 초래할 수 있습니다.
이는 다음에 소개할 디자인 조합폭발과 일관성 문제와 정면으로 충돌합니다.

지금은 레이아웃 문제를 Bootstrap이나 Bulma와 같은 프레임워크에 위임하고 관리에 더 집중할 수 있습니다.

4. 디자인의 배경

기본적으로 CSS는 웹 개발에서 디자인을 표현하고 구현하는 강력한 도구입니다.

UI/UX를 만들 때 고려해야 할 요소는 다양하며, 디자인에서 표현하는 데 중요한 요소는 다음과 같습니다.
Rethinking CSS in JS

  1. 시각 디자인
    • 레이아웃: 화면의 구조와 요소의 배치를 결정합니다. 요소 간의 간격, 정렬 및 계층 구조를 고려하세요.
    • 색상: 브랜드 아이덴티티와 사용자 경험을 고려한 색상 팔레트를 선택하세요. 색이론에 대한 이해가 필요합니다.
    • 타이포그래피: 가독성과 브랜드 이미지에 어울리는 글꼴과 텍스트 스타일을 선택하세요.
    • 아이콘 및 그래픽 요소: 직관적이고 일관된 아이콘과 그래픽을 디자인합니다.
  2. 인터랙션 디자인
    • 버튼, 슬라이더, 스크롤바 등 UI 요소의 동작을 디자인합니다.
    • 애니메이션과 전환 효과를 통해 자연스러운 사용자 경험을 제공합니다.
    • 다양한 화면 크기에 적응하는 반응형 디자인을 고려해보세요.
  3. 정보 아키텍처
    • 사용자가 정보를 쉽게 찾고 이해할 수 있도록 콘텐츠의 구조와 계층을 디자인하세요.
    • 사용자가 원하는 위치로 쉽게 이동할 수 있도록 내비게이션 시스템을 디자인하세요.
  4. 접근성 및 사용성
    • 다양한 사용자를 고려한 포용적 디자인을 추구합니다. i18n도 포함될 수 있습니다.
    • 직관적이고 사용하기 쉬운 인터페이스를 만들어 사용자의 인지 부하를 줄입니다.
  5. 일관성 및 스타일 가이드
    • 애플리케이션 전체에서 일관된 디자인 언어를 유지하기 위한 스타일 가이드를 만듭니다.
    • 재사용 가능한 구성 요소와 패턴을 개발하여 효율성을 높입니다.

다양한 조건에 걸쳐 다양한 디자인 요소를 정확하게 표현하는 것은 중요한 과제입니다.
장치(휴대폰, 태블릿, 노트북, 모니터, TV), 입력 장치(키보드, 마우스, 터치, 음성), 가로/세로 모드, 어두운/밝은 테마, 고대비 모드, 국제화(언어)를 고려해야 한다는 점을 고려하세요. , LTR/RTL) 등이 있습니다.
또한 사용자 설정에 따라 다른 UI가 표시되어야 할 수도 있습니다.

그러므로 조합 폭발은 불가피하며, 수동으로 하나씩 구현하는 것은 불가능합니다. (이미지 출처)

Rethinking CSS in JS

대표적인 예로 내 Firefox 테마의 탭 표시줄 레이아웃 정의 및 편집을 참조하세요.
OS와 사용자 옵션만 고려하더라도 약 360줄의 파일이 약 1400줄에 달하는 컴파일 결과를 낳는다.

결론은 효과적인 디자인 구현은 본질적으로 확장 가능해야 하며 일반적으로 프로그래밍 방식으로 또는 잘 정의된 규칙 세트를 통해 관리된다는 것입니다.
그 결과 규모에 맞게 일관되게 관리할 수 있는 설계 시스템이 탄생했습니다.

5. 디자인 시스템의 배경

디자인 시스템은 시각적 스타일부터 UI 패턴 및 코드 구현에 이르기까지 디자인 및 개발의 모든 측면을 포괄하는 정보의 단일 소스 역할을 합니다.

Rethinking CSS in JS

Nielsen Norman Group에 따르면 디자인 시스템에는 다음이 포함됩니다.

  • 스타일 가이드: 브랜드, 콘텐츠, 시각 디자인 등 특정 스타일 요구 사항에 대한 스타일 지침을 제공하는 문서입니다.
  • 구성 요소 라이브러리: 버튼과 같은 재사용 가능한 개별 UI 요소를 지정합니다. 각 UI 요소에 대해 사용자 정의할 수 있는 속성(크기, 복사 등), 다양한 상태(활성화, 호버, 포커스, 비활성화), 재사용 가능한 깨끗하고 긴밀한 코드와 같은 정보를 포함하여 특정 디자인 및 구현 세부 정보가 제공됩니다. 요소.
  • 패턴 라이브러리: 재사용 가능한 패턴 또는 구성 요소 라이브러리에서 가져온 개별 UI 요소 그룹을 지정합니다. 예를 들어 제목, 탐색경로, 검색, 기본 및 보조 버튼으로 구성될 수 있는 페이지 헤더의 패턴을 볼 수 있습니다.
  • 디자인 리소스: 디자이너가 컴포넌트와 라이브러리를 실제로 사용하고 디자인하려면 디자인 파일이 필요합니다(보통 Figma에 있음). 일반적으로 디자이너와 개발자가 사용할 수 있도록 로고, 서체, 글꼴, 아이콘 등의 리소스도 포함되어 있습니다.

디자인 시스템은 기능성, 형태, 접근성, 맞춤화를 지원하는 디자이너와 개발자의 교차로 역할을 해야 합니다.
하지만 디자이너와 개발자는 다르게 생각하고 관점이 다릅니다.

컴포넌트를 렌즈로 삼아 디자이너와 개발자의 관점 차이를 인식해보자!!

5.1 구성 요소 구조

디자이너는 체크박스 컨트롤에 사용할 아이콘도 결정해야 합니다.
Rethinking CSS in JS

디자이너는 형태에 집중하는 경향이 있고, 개발자는 기능에 집중하는 경향이 있습니다.
디자이너의 경우 버튼은 누르기 좋아 보이는 버튼인 반면, 개발자의 경우 누를 수 있는 버튼은 버튼입니다.

컴포넌트가 복잡해지면 디자이너와 개발자의 격차가 더욱 벌어질 수 있습니다.

Rethinking CSS in JS

5.2 디자이너 고려사항

  • 시각적 옵션: 기본, 악센트, 윤곽선, 텍스트 전용 등 설정된 옵션에 따라 모양이 변경됩니다.
    Rethinking CSS in JS

  • 상태 옵션: 상태와 상황에 따라 모양이 달라집니다
    Rethinking CSS in JS

  • 디자인 결정: 구성요소 구조, 시각적/상태 옵션, 시각적 속성(색상, 타이포그래피, 아이콘 등) 등을 통해 값 결정

5.3 개발자 고려사항

  • 옵션: 초기값을 구성할 수 있습니다. 시각적 옵션도 포함되어 있습니다. 예) 외곽선, 크기
  • 상태: 사용자 상호작용에 따라 변경됩니다. 예) 호버, 누름, 포커스, 선택(체크)
  • 이벤트: 상태 변화를 유발하는 작업입니다. 예) HoverEvent, PressEvent, FocusEvent, ClickEvent
  • 컨텍스트: 동작에 영향을 미치는 코드에서 주입된 조건입니다. 예) 읽기전용, 비활성화

최종 형태는 Option, State, Context의 조합으로 위에서 언급한 조합 폭발을 초래합니다.

이 중 Option은 디자이너의 관점에 부합하지만 State와 Context는 그렇지 않습니다.
디자이너 관점으로 돌아가기 위해 병렬 상태, 계층 구조, 가드 등을 고려하여 상태 압축을 수행합니다.
Rethinking CSS in JS

  • 활성화됨: 비활성화됨 꺼짐, 눌러짐 꺼짐, 마우스 오버됨 꺼짐, 초점 꺼짐
  • 마우스 올리기: 비활성화됨 꺼짐, 눌러짐 꺼짐, 마우스 오버됨 켜짐
  • 집중: 비활성화됨 꺼짐, 눌러짐 꺼짐, 집중됨 켜짐
  • 눌림: 비활성화됨 OFF, 눌러짐
  • 비활성화: 비활성화 ON

6. 스타일 관리는 어떻게 이루어졌나요?

지금쯤이면 아시겠지만 고품질 UI를 만들고 유지하는 것은 어려운 일입니다.

그렇다면 상태 관리 라이브러리에서 다양한 상태를 다루고 있는데 스타일 관리는 어떻게 이루어졌나요?
솔루션이 아직 확립되지 않아 방법론, 라이브러리, 프레임워크가 계속해서 등장하고 있지만 세 가지 주요 패러다임이 있습니다.
Rethinking CSS in JS

  1. 시맨틱 CSS: 요소의 목적이나 의미에 따라 클래스를 지정합니다.
  2. Atomic CSS: 각 스타일(시각적) 속성에 대해 하나의 클래스를 만듭니다.
  3. JS의 CSS: JavaScript로 작성하고 각 구성 요소 단위에 대해 CSS를 분리합니다.

이중 JS의 CSS는 스타일을 표현하고 관리하는 방식이 근본적으로 다른 패러다임처럼 느껴집니다.
JS의 CSS는 메커니즘과 같고 Semantic CSS와 Atomic CSS는 정책과 같기 때문입니다.
이러한 차이점으로 인해 JS의 CSS는 다른 두 가지 접근 방식과 별도로 설명되어야 합니다. (이미지 출처)

Rethinking CSS in JS

JS 메커니즘의 CSS를 논의할 때 CSS 사전/사후 프로세서가 떠오를 수 있습니다.
마찬가지로 정책을 이야기할 때 'CSS 방법론'이 떠오를 수도 있습니다.

그러므로 스타일 관리 방법을 다음 순서로 소개하겠습니다: JS의 CSS, 프로세서, Semantic CSS 및 Atomic CSS, 기타 스타일 방법론

6.1 JS의 CSS

그렇다면 JS에서 CSS의 정체는 무엇일까요?
그 답은 위의 정의에 있습니다.

각 구성 요소 단위는

JavaScript로 작성하고 CSS를 분리

합니다.
  1. JavaScript로 작성된 CSS
  2. 구성요소 수준의 CSS 격리

이 중 CSS 격리를 기존 CSS에 충분히 적용하면 전역 네임스페이스 및 격리 해제 문제를 해결할 수 있습니다.
CSS 모듈입니다.

Rethinking CSS in JS

위에서 언급한 JS 분석 기사의 CSS 링크를 바탕으로 기능을 다음과 같이 분류했습니다.
각 기능에는 장단점이 있으며 이는 JS에서 CSS를 생성할 때 중요한 요소입니다.

6.1.1 통합

특히 주목할만한 콘텐츠는 SSR(Server Side Rendering)과 RSC(React Server Component)일 것입니다.
이는 프론트엔드를 대표하는 React와 NEXT가 지향하는 방향이며, 구현에 지대한 영향을 미치기 때문에 중요합니다.

  • IDE: 구문 강조 및 코드 완성
  • TypeScript: 유형이 안전한지 여부
  • 프레임워크
    • 불가지론적: 프레임워크에 독립적이며 StyledComponent와 같은 라이브러리는 React용으로 특별히 설계되었습니다.
    • SSR: 서버에서 렌더링할 때 스타일을 문자열로 추출하고 하이드레이션을 지원합니다
    • RSC: RSC는 서버에서만 실행되므로 클라이언트 측 API를 사용할 수 없습니다.

서버사이드 렌더링은 서버에서 HTML을 생성해 클라이언트로 보내기 때문에 문자열로 추출해야 하고, 스트리밍에 대한 응답이 필요합니다. Styled Component의 예시와 같이 추가적인 설정이 필요할 수 있습니다. (이미지 출처)

Rethinking CSS in JS

  1. Server-side style extraction
    • Should be able to extract styles as strings when rendering on the server
    • Insert extracted styles inline into HTML or create separate stylesheets
  2. Unique class name generation
    • Need a mechanism to generate unique class names to prevent class name conflicts between server and client
  3. Hydration support
    • The client should be able to recognize and reuse styles generated on the server
  4. Asynchronous rendering support
    • Should be able to apply accurate styles even in asynchronous rendering situations due to data fetching, etc.

Server components have more limitations. [1, 2]
Server and client components are separated, and dynamic styling based on props, state, and context is not possible in server components.
It should be able to extract .css files as mentioned below.

Rethinking CSS in JS

  1. Static CSS generation
    • Should be able to generate static CSS at build time
    • Should be able to apply styles without executing JavaScript at runtime
  2. Server component compatibility
    • Should be able to define styles within server components
    • Should not depend on client-side APIs
  3. Style synchronization between client and server
    • Styles generated on the server must be accurately transmitted to the client

6.1.2 Style Writing

As these are widely known issues, I will not make any further mention of them.

  • Co-location: Styles within the same file as the component?
  • Theming: Design token feature supports
  • Definition: Plain CSS string vs Style Objects
  • Nesting
    • Contextual: Utilize parent selectors using &
    • Abitrary: Whether arbitrary deep nesting is possible

6.1.3 Style Output and Apply

The notable point in the CSS output is Atomic CSS.
Styles are split and output according to each CSS property.

Rethinking CSS in JS

  • Style Ouput
    • .css file: Extraction as CSS files