2000?? ? Divitis?? ???? div ??? ?? ???? ??? ???? ??? ????. ?? ?? HTML ??? ??
. ?? ??? ?? ??? ? ??? HTML? ??? ?? ??? ???? ??? ???????.
20?? ??? ?? ? ????? ??? ??? ??? ???? ??????. ?? ?? ?????? ????. ?? ??? ??? ??? ????.
?????: ? ???? ??? ??? ??? ?? UI? ?? ??? ?? ????? ??? ??.
????
?? ?? ????? ?????? ? ???? React? ?? ??? ???? ?? ? ??? ???? ? ????.
React? ???? ???, CSS ? JavaScript? ??? ?? "?? ??", ?? ??? ??? UI ??
? ??? ? ????. — React ?? - ? ?? ?? ??
??? ??? UI ???? ??? ???? ??? ?? ?????(CSS?? ?? OOCSS, SMACSS, BEM? ?? ??? ?????), ?? ???? ??? ??, ??? ? ??? ?? ???? ?? ?????. ?? ??. React ?? ??(? ?? ?? UI ?????)? ???? ?? ?? ?? ??? ?? ??? ?? ??? ?? ??? ??? ? ????.
??? Facebook? ?? CSS ?????? Stylex? ???? ??? ?? ??? ? ????.
import * as stylex from "@stylexjs/stylex"; import { useState } from "react"; // styles const styles = stylex.create({ base: { fontSize: 16, lineHeight: 1.5, color: "#000", }, }); export function Toggle() { // interactions const [toggle, setToggle] = useState(false); const onClick = () => setToggle((t) => !t); // markup return ( <button {...stylex.props(styles.base)} type="button" onClick={onClick}> {toggle} </button> ); }
?? ????? CSS? ???? ?? ??? ?? ?? ??? ?? ?? ??? ??? ??? ?? ??? ?? ?? ?? ?? ????? ?? ?? ???? ?? ??? ?? ?????. ????? ??????.
Svelte? ?? ???????? ?? ??? ?? ? ???? ??? ? ?????.
<script> let toggle = $state(false) const onclick = () => toggle = !toggle </script> <button type='button' {onclick}> {toggle} </button> <style> button { font-size: 16px; line-height: 1.5; color: #000; } </style>
??? ??? ?? ? ??? ?? ?? ?? ??? ???? ??? ?? ??? ?????. ??? ??? ?? ??? ?? ??? ??? ????.
export function Page() { return ( <Layout> <Header nav={<Nav />} /> <Body> <Stack spacing={2}> <Item>Item 1</Item> <Item>Item 2</Item> <Item>Item 3</Item> </Stack> </Body> <Footer /> </Layout> ); }
??? ?? ??
? ??? ???? ????? ????. ???? ???? ?? ???? ?????? ?????.
?? ?? ??? ???? ???????. ? ?? ??? ????? ?? ?? ?? ??? ???? ??? ??? ???? ????? ?? ?????.
import * as stylex from "@stylexjs/stylex"; import type { PropsWithChildren } from "react"; const styles = stylex.create({ root: { display: "flex", flexDirection: "column", }, spacing: (value) => ({ rowGap: value * 16, }), }); export function Stack({ spacing = 0, children, }: PropsWithChildren<{ spacing?: number }>) { return ( <div {...stylex.props(styles.root, styles.spacing(spacing))}> {children} </div> ); }
??? ????? ???? ?? ??? ?????.
? ?? ??? ?? ???? ??? ?? ??? ????? ?? ?? ????. HTML? CSS ??? ??? ???? ?? ???? ?????? ????? ?? ?????. ??.
???? (?? ? ??) ??
?? ?? ??? ???? ????? ?? ??? ????? ??? ?? ???? ??? ??? ?? ??? ???? ???? ???. React? TypeScript??? ??? ?? ? ? ????.
import * as stylex from "@stylexjs/stylex"; import { useState } from "react"; // styles const styles = stylex.create({ base: { fontSize: 16, lineHeight: 1.5, color: "#000", }, }); export function Toggle() { // interactions const [toggle, setToggle] = useState(false); const onClick = () => setToggle((t) => !t); // markup return ( <button {...stylex.props(styles.base)} type="button" onClick={onClick}> {toggle} </button> ); }
? ???? ? ??? ?? ???? ?? ?? ????. ??? ?????: ??? 3?? CSS ???? ??? ????? ????.
???? ????
?? ? Angular?? ???? ????? ???? ?????. ?? ??? ???? ? ???? ?? ?? ??? ???? ??? ??????. Angular??? ??? ????? ???? ?? ?? ? ????? ?? ??????.
?? ??? ??? ?? ????, ???? ?????. ???? ?? ? ?? ???? ? ??? ??? ??? ?? ?? ???? ????
<script> let toggle = $state(false) const onclick = () => toggle = !toggle </script> <button type='button' {onclick}> {toggle} </button> <style> button { font-size: 16px; line-height: 1.5; color: #000; } </style>
??? ??? Stack? ?? ???? ?????. ????? CSS? ???? ???? ?? ??? ? ????.
export function Page() { return ( <Layout> <Header nav={<Nav />} /> <Body> <Stack spacing={2}> <Item>Item 1</Item> <Item>Item 2</Item> <Item>Item 3</Item> </Stack> </Body> <Footer /> </Layout> ); }
JavaScript ?????? ?? ??? ??
CSS ?? ???? ???? IDE ?? ?? ??? ???? ????.
?? ?? ??? ???? ?? ?? ?? ?? ?? ???? ??? ??? ?? ???? ?? ?? ???? ??? ? ????. React? ????? ???? JSX? ???? ???? ??? ?? ? ????.
import * as stylex from "@stylexjs/stylex"; import type { PropsWithChildren } from "react"; const styles = stylex.create({ root: { display: "flex", flexDirection: "column", }, spacing: (value) => ({ rowGap: value * 16, }), }); export function Stack({ spacing = 0, children, }: PropsWithChildren<{ spacing?: number }>) { return ( <div {...stylex.props(styles.root, styles.spacing(spacing))}> {children} </div> ); }
React TypeScript? ? ? ?? CSS ??? ???? ????. ???? ?? ?? ???? ????? ? ??? ???? ???? ???.
??? ???? ?? ???? ??? ???? PandaCSS ??? ??? ??? ??? ??? ? ????.
import * as stylex from "@stylexjs/stylex"; type PolymorphicComponentProps<T extends React.ElementType> = { as?: T; children?: React.ReactNode; spacing?: number; } & React.ComponentPropsWithoutRef<T>; const styles = stylex.create({ root: { display: "flex", flexDirection: "column", }, spacing: (value) => ({ rowGap: value * 16, }), }); export function Stack<T extends React.ElementType = "div">({ as, spacing = 1, children, ...props }: PolymorphicComponentProps<T>) { const Component = as || "div"; return ( <Component {...props} {...stylex.props(styles.root, styles.spacing(spacing))} > {children} </Component> ); }
?? ?? ? ????? ? ??
??? ? ??? ??? ??? CSS? ???? ?? ??? ???? ?? ?? ??????? ??? ????? ????. ?? ????? ???? ? ??? ??? ??? ???? ?? ??? ??? ? ? ????.
?????? ???? ?? ???? ??? ?? ???? ?? ??? ??? ??? ? ????. ??? ??? ???? CSS ??? ??? typed-css-modules? ????? ???? ?? ?? ?? ??? ??? ????? ?? ???? ? ????.
<div> <pre class="brush:php;toolbar:false">.stack { --s: 0; display: flex; flex-direction: column; row-gap: calc(var(--s) * 16px); }
export function Page() { return ( <Layout> <Header nav={<Nav />} /> <Body> <div className="stack"> <p>Let's see the main advantages of this approach:</p> <ul> <li>reusability</li> <li>reduced complexity</li> <li>smaller JavaScript bundle and less overhead</li> <li><strong>interoperability</strong></li> </ul> <p>The last point is easy to overlook: Not every project uses React, and if you’re including the stack layout pattern in a Design System or a redistributable UI library, developers could use it in projects using different UI frameworks or a server-side language like PHP or Ruby.</p> <h2> Nice features and improvements </h2> <p>From this base, you can iterate to add more features and improve the developer experience. While some of the following examples target React specifically, they can be easily adapted to other frameworks.</p> <h3> Control spacing </h3> <p>If you're developing a component library you definitely want to define a set of pre-defined spacing variants to make space more consistent. This approach also eliminates the need to explicitly write the style attribute:<br> </p> <pre class="brush:php;toolbar:false">.stack { --s: 0; display: flex; flex-direction: column; row-gap: calc(var(--s) * 16px); &.s\:1 { --s: 1 } &.s\:2 { --s: 2 } &.s\:4 { --s: 4 } &.s\:6 { --s: 6 } } /** Usage: <div> <p>For a bolder approach to spacing, see Complementary Space by Donnie D'Amato.</p> <h3> Add better scoping </h3> <p>Scoping, in this case, refers to techniques to prevent conflicts with other styles using the same selector. I’d argue that scoping issues affects a pretty small number of projects, but if you are really concerned about it, you could:</p> <ol> <li>Use something as simple as CSS Modules, which is well supported in all major bundlers and frontend frameworks.</li> <li>Use cascade layers resets to prevent external stylesheets from modifying your styles (this is an interesting technique).</li> <li>Define a specific namespace like .my-app-... for your classes.</li> </ol> <p>Here is the result with CSS Modules:<br> </p> <pre class="brush:php;toolbar:false">.stack { --s: 0; display: flex; flex-direction: column; row-gap: calc(var(--s) * 16px); &.s1 { --s: 1 } &.s2 { --s: 2 } &.s4 { --s: 4 } &.s6 { --s: 6 } } /** Usage import * from './styles/stack.module.css' <div className={`${styles.stack} ${styles.s2}`}> // ... </div> */
??
??? ??? ?? ??? ? ??? ????? ?? HTML? ??? ??? ? ??? CSS? ??? ??? ???? ?? ???(??? ?????) ?? ??? ??? ????. PandaCSS? ???? ??? ?? ??? ???? ??? ??? ?? ?? ??? ?????. ? ???? ??? ??? ???? ??? CSS ??????? ??? ?? ???? ??? ????.
???? ?? ? ?? ??? ??? ????? ? ?? ??? ????? ??? ?? Tailwind CSS???.
Tailwind?? ??? ?? ?? ??? ???? ??? ?? ?? ????? ?? ? ????.
import * as stylex from "@stylexjs/stylex"; import { useState } from "react"; // styles const styles = stylex.create({ base: { fontSize: 16, lineHeight: 1.5, color: "#000", }, }); export function Toggle() { // interactions const [toggle, setToggle] = useState(false); const onClick = () => setToggle((t) => !t); // markup return ( <button {...stylex.props(styles.base)} type="button" onClick={onClick}> {toggle} </button> ); }
??? Tailwind? ?? ?? ??? ???? ???? ??? CSS ?? ??? ???? ?? matchComponents? ?? ?? ?? ??? ????? ?? ??????. ??? ??? ?? ?? ??? ???? ? ?? ?????
?????
?????? ??? ???? ??? ?? ??? ??? ??? ??? ???? ???? ?? ??? ???? ?????. ????? ??? ?? ??? ????? ?? ??? ?? ??? ?? ????? ????? ? ??? ????? ???? ???? ?? ?? ???? ??? ?????. ???? ??? ???? ?? ?? ??? ?????. ??? ?? ???? ?? ?? ??? ?? ?? ??? ??? ? ????.
? ??? ?? ?? ????? ??? ?? ????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??











CSS? ??? ??? ????? ????? ??? ? ?? CSS? ????? ?? ??????, ?? ?? ? ??? ??, ??? ?? ?? ??? CSS ? ????? ?? ??? ?? ???? ???? ??? ??? ???. 1. ?? CSS? ???? HTML? ?? ?????. 2. JavaScript? ?? ??? CSS ??; 3. ??? ??? ???? ?? ???? ????? ??????. 4. CSS? ???? ???? ??? ????. ?? CSS? ???? ?? ??? ???? Rel = "Preload"?????? ????, ??? ?? ??? ????? ???? ??? ?? ? ??? ???? ??? ?????.

TheBestoproachforcssdspectionseproject'sspecificneeds.forlargerProjects, externalcsSisbetterduetomainabainabainabilitableability ? forsmallerprojectsorsingle-pageapplications, ?? csmightbemoresuitable.it 'scrucialtobalanceprojectsize, ??

???, cssdoesnothavetobeInlowercase. ???, lowercaseisRecomedended for : 1) ??? ? ??, 2) ??? ?? rorsinerrorsinerrorsIngerRorsIngerRorsInteChnologies, 3) ??? ?? ??, ? 4) ?? ? ???? ????.

cssismostlycase-Insensitive, buturlsandfamilynamesarecase-insensitive.1) propertiesandvalueslikecolor : red; anteOtcase-inditive.2) urlsmustmatchtheserver'scase, ?? ??,/images/logo.png.3) fontfamilynames'opens'mustoccase.

AutoPrefixer? ?? ???? ??? ???? ?? ?? ???? CSS ??? ???? ???? ?????. 1. ????? ???? ???? ???? ??? ?????. 2. PostCSS ???? ??, CSS? ?? ???? ???? ?? ???? ??? ???? ??? ?? ??? ?????. 3. ?? ???? ???? ??, ??????? ?? ? ?? ???????? ????? ?? ?????. 4. ???? ???? ???? ???? ?? ?? ????, ???? ?? ??? ?? ???? ???? ????? ?? ???? ?? ????.

CSSCOUNTERSCANAUTOMALLYNUMBERSESSESSENDS.1) USECOUNTER-RESETTIONITIALIZE, CORKENT-INCREMENTTOINCERES, andCOUNTER () ORCOUNTERS () TODISPLAYVALUES.2) COMPINEWITHJAVAISCRIPTORDINAMICCONTENTTOEREACCUTERUPDATES.

CSS?? ??? ? ?? ??? ?? ??? ???? ??, ??, URL ? ??? ?? ????? ?? ?? ??? ?????. 1. ???? ?? ??? ??? ? ???? ?? ?? ??? ??????. 2. ?? 16 ?? ??? ?? ??? ?????, ??? ???? ???? ?? ??? ??? ???? ????. 3. URL? ??? ???? ???? ??? ??? ? ????. 4. ??? ?? ?? (??)? ??? ???? ??? ? ???? ??????? ???????.

theconic-gradient () functionincsscreatescurcular gradientsthattroTecolorstopsaroundacentral point
