CSS ?? ??? ???, ???? ???????.
?? ???? var()? ????? ???????. ??? ? ?? ?? ?:
- CSS ??? ??? ?????
- ??? ?? ?? ??? ?? ?? CSS ?? ?? ??
var() ??
var()? ??? ?? ?? ?(CSS ??)? ??????. ??? ??? ????.
var( <custom-property-name>, <fallback-value>? )
?? ??
-
? ?? ????? CSS ???? ???. var(20px)? ?? ???? ?? ??? ?????. var()? ??? ?? ?? ??? ???? ?????.
var()? ?? ??? ??? ? ????. ?, var(--prop-name): 20px; var()? ?? ??? ????? ???? ?? ?????.
.foo { margin: var(20px); /* Error, 20px is not a CSS variable */ --prop-name: margin-top; var(--prop-name): 20px; /* Error, cannot use var() this way */ }
??? ??
var(--b, fallback_value) ??: ? ?? ????? --b? ???? ?? ?? ???? ?? ? ??? ???.
var(--c,) ? ?? ??: ?? ?? ?? ?? ?? ??? ??? ??? ???? --c? ???? ?? ?? ????? ? ?? ?????. .
-
?? ??: var(--d, var(--e), var(--f), var(--g))?? ? ?? ?? ?? ?? ??? ??? ????. ???? ????? --d? ???? ?? ?? var() ???? var(--e), var(--f), var(--g)? ??? ???? ???? ??? ?????.
??? CSS ?????? var(): ? ??? 20px?? ??? CSS ?? ??? ???. ??? var(--size)var(--unit)? 20px? ???? ??? ???? ?? ??? ?????.
CSS ??? ??? ??: CSS ??? ???? ???? ?? ??? ???? ??? ?????. ???? ??? ????? fallback? ???? ???.
url() ? var() ???: url()? ??? CSS ???? ????? ?? ??? ?? url()? ???? ???.
:root { /* 1. */ margin: var(--b, 20px); /* Uses 20px if --b is invalid */ /* 2. */ padding: var(--c,) 20px; /* Falls back to 20px if --c is invalid */ /* 3. */ font-family: var(--fonts, "lucida grande", tahoma, Arial); /* Uses fallback font stack if --fonts is invalid */ /* 4. */ --text-size: 12; --text-unit: px; font-size: var(--text-size)var(--text-unit); /* Invalid, as it does not resolve to 12px */ /* 5. */ --initialized: initial; background: var(--initialized, initial); /* Results in background: initial */ /* 6. */ --invalid-url: "https://useme.medium.com"; background: url(var(--invalid-url)); /* Invalid, as url() cannot parse var() */ --valid-url: url(https://useme.medium.com); background: var(--valid-url); /* Correct usage */ }
?? ??? ? ??
CSS ??? ?? CSS ??? ????? ?? ? ???? ?? CSS ?? ??? ????. ??? ??? CSS ??? ?? ??? ???? ???? ?? ??? ??? ?????.
?? ? ?? ??:
:root? ??? ??? ????? ???? ??, ???? ??? ??? ??? ? ??????.
:root { --main-color: blue; /* Globally applied */ } .container { --main-color: green; /* Scoped, applies only within .container */ }
???? ?? ????:
? ?? ???? CSS ??? ?? ? ?? ???? ??????.
var( <custom-property-name>, <fallback-value>? )
.foo { margin: var(20px); /* Error, 20px is not a CSS variable */ --prop-name: margin-top; var(--prop-name): 20px; /* Error, cannot use var() this way */ }
? ??? .box? --green: 0?? ????? ?? -- background? rgb(255, 255, 255)? ??????? .box? ???? ???? ?????.
?? ???? ???? ?? ???:
??? ??? ???? ?? ??? ??? ?? ??? ?????.
:root { /* 1. */ margin: var(--b, 20px); /* Uses 20px if --b is invalid */ /* 2. */ padding: var(--c,) 20px; /* Falls back to 20px if --c is invalid */ /* 3. */ font-family: var(--fonts, "lucida grande", tahoma, Arial); /* Uses fallback font stack if --fonts is invalid */ /* 4. */ --text-size: 12; --text-unit: px; font-size: var(--text-size)var(--text-unit); /* Invalid, as it does not resolve to 12px */ /* 5. */ --initialized: initial; background: var(--initialized, initial); /* Results in background: initial */ /* 6. */ --invalid-url: "https://useme.medium.com"; background: url(var(--invalid-url)); /* Invalid, as url() cannot parse var() */ --valid-url: url(https://useme.medium.com); background: var(--valid-url); /* Correct usage */ }
???? CSS ??? ?? ? ?? ?? ?? ??? ???????.
?? ? A: ?????
CSS ??? ????? ??? ??? ??? ? ?? ??? ?? ?????? ??? ? ????. ? ??? ????? @property? ???? ??? ??? ?? ?? ???? ????? ??? ?????? ???? ??? ??? ? ????.
:root { --main-color: blue; /* Globally applied */ } .container { --main-color: green; /* Scoped, applies only within .container */ }
:root { --main-color: blue; } .section { --main-color: green; /* Overrides :root definition */ } .section p { color: var(--main-color); /* Shows green */ } p { color: var(--main-color); /* Shows blue */ }
??? ?? ??? ?? ?? ?? ??
??? ??? ????? ??? ????? ????? ?? ??? ??? ?? ??? ???? ??? ? ?? ??? ??? ? ????. ?? ???? ?? ??? ???? ???? ??? ? ????. ?????? ????? ???? ?? ??, ??? ???? ??? ??? ?????.
??? CSS? ??? ??? ???? ???? ?? ?? ???? ??? ??? ? ????. ?? ??? ????? ?? ?????. ??? ??? ???? ?? CSS ??? :has() ???? ???? ???? ??? ?? ?? ??? ??? ? ????.
? ?? ?? CSS? ????? ???? ???? ???? ??? ??? ??? ???? ?? ? ?? ??? CSS???? ??? ??? ???? ???? ??? ? ????.
?? ?? ? ??? ?? ???????. ?? ??? ??? ????.
- CSS? ???? ???? 'OFF' ??? ?? ??? ???? 'ON'? ??? ??? ???? ?? ???? ??????.
???? ?? ??? ??? ??: ???? ?? ???? "OFF" ??(?? ??)? ?????. ??? “ON”??(????)? ?????.
???? ?? ??? ??? ??: ??? ?? ??? ????? ??? ??? ?????. ???? ???? ??? "ON"(?? ??)? ?????. ??? “OFF”(??? ??)? ?????.
? ??? ???? ? ?? ?? ??? ?????.
? ??: ??? ?? ? ???? ??? ?? ???? ??
var( <custom-property-name>, <fallback-value>? )
? ??: ??? ?? ? ON/OFF ??? ?? ??? ??? ?? ?? ??
?? ??? ??? ??? CSS ??? ??? ??? ?? ?????.
.foo { margin: var(20px); /* Error, 20px is not a CSS variable */ --prop-name: margin-top; var(--prop-name): 20px; /* Error, cannot use var() this way */ }
CSS ?? ???? ?? ?? ???
???? Space Toggle ??? ???? ?? ??? ????????. ??? ??? ?? ??? ?? ?????.
:root { /* 1. */ margin: var(--b, 20px); /* Uses 20px if --b is invalid */ /* 2. */ padding: var(--c,) 20px; /* Falls back to 20px if --c is invalid */ /* 3. */ font-family: var(--fonts, "lucida grande", tahoma, Arial); /* Uses fallback font stack if --fonts is invalid */ /* 4. */ --text-size: 12; --text-unit: px; font-size: var(--text-size)var(--text-unit); /* Invalid, as it does not resolve to 12px */ /* 5. */ --initialized: initial; background: var(--initialized, initial); /* Results in background: initial */ /* 6. */ --invalid-url: "https://useme.medium.com"; background: url(var(--invalid-url)); /* Invalid, as url() cannot parse var() */ --valid-url: url(https://useme.medium.com); background: var(--valid-url); /* Correct usage */ }
??? ??? --Background-color: var(--light, #fbfbfb) var(--dark, #121212); ?? ????. ??? ???? --light ? --dark ?? ?? ???? ??? if/else? ????? ????????.
??? ?????? ???? --light: var(--ON); --ON: ??; --ON? ??? ??? ????. ?? --OFF? ? ???? ?????. var(--light, #fbfbfb) var(--dark, #121212)? ???? ???? ?? --light ??? ???? #fbfbfb? ???? ??? --dark ??(?? ??)? --Background-color? ?????. #fbfbfb? ????.
?? ?? ?? ??? ??? ??? ??? --light ? --dark? ??? ?? ?????. ??? ?? ? ?? ??? ? ?? ???? ???.
?? ??? ???????. ?? ??? ???? ?? --light: var(--OFF);? ??????. ? --dark: var(--ON);. ??? ????? ?? ??? ???. ?? ?????? ??? ? ??? ?? CSS?? ?? ??????. ? ?? ???? ??? ??? ? ??? ????.
?? ?: CodePen ?
??
CSS? 2016? ?? ?? ?????? CSS ??? ??? ? ?? ??? ?? ???? ????. @property ? :has()? ?? ??? ??? CSS ??? ???? ?? ???? ????. ?? ??? ??? ???? CSS ??? ?? ????? ????. ?? ?? ?? ??? ?? ?????? ???? ????? ???? ??? ?? ? ????. ????? ??? ??? ????? CSS? ??? ???? ?? ???? CSS ??? ?? ??? ??? ?? ?? ??? ??? ?? ? ???? ?? ?????.
????
- https://stackoverflow.com/questions/42330075/is-there-a-way-to-interpolate-css-variables-with-url/42331003#42331003
- https://kizu.dev/cycl-toggles/#was-this-always-possible
- https://dev.to/afif/what-no-one-told-you-about-css-variables-553o
- https://hackernoon.com/cool-css-variable-tricks-to-try-uyu35e9
- https://lea.verou.me/blog/2020/10/the-var-space-hack-to-toggle-multiple-values-with-one-custom-property/
? ??? CSS ??? ??? ?? ?? - var() ? ?? ?? ??? ?? ?????. ??? ??? 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. ??? ?? ?? (??)? ??? ???? ??? ? ???? ??????? ???????.

cssselectorsandpropertynamesarecase-inensensitive, whilevaluescanbecase-sensitivendependingOntext.1) selectorsike'div'and'div'areequivalent.2) propertiessuchas'background'and'background-color'AretreatedThesame.3) ValueLikecolornames-insens
