{"id":481671,"date":"2026-05-30T09:23:18","date_gmt":"2026-05-30T09:23:18","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=481671"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=481671","title":{"rendered":"\u042f \u0441\u0434\u0435\u043b\u0430\u043b Vite-\u043f\u043b\u0430\u0433\u0438\u043d, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f CSS \u043f\u0440\u044f\u043c\u043e \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<blockquote>\n<p>\u042d\u0442\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0425\u0430\u0431\u0440\u0435. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043a\u0440\u0438\u0442\u0438\u043a\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<\/blockquote>\n<hr\/>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u044f \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0441\u0442\u0443\u043f \u0438\u043b\u0438 \u0446\u0432\u0435\u0442 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u044f \u0434\u0435\u043b\u0430\u043b \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435:<\/p>\n<p>\u043e\u0442\u043a\u0440\u044b\u043b DevTools \u2192 \u043d\u0430\u0448\u0451\u043b \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u2192 \u043f\u043e\u043c\u0435\u043d\u044f\u043b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2192 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u2192 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u2192 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u2192 \u043d\u0430\u0448\u0451\u043b \u0444\u0430\u0439\u043b \u2192 \u0432\u0441\u0442\u0430\u0432\u0438\u043b.<\/p>\n<p>\u042d\u0442\u043e \u0441\u0435\u043c\u044c \u0448\u0430\u0433\u043e\u0432 \u0440\u0430\u0434\u0438 \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u042f \u0441\u0434\u0435\u043b\u0430\u043b <a href=\"https:\/\/github.com\/Artyx71\/livestylesync\" rel=\"noopener noreferrer nofollow\">LiveStyleSync<\/a>, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0431\u044b\u043b \u043e\u0434\u0438\u043d \u0448\u0430\u0433.<\/p>\n<h3>\u0427\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435<\/h3>\n<p>LiveStyleSync \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0430\u043d\u0435\u043b\u044c \u043f\u043e\u0432\u0435\u0440\u0445 \u0432\u0430\u0448\u0435\u0433\u043e Vite-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0412\u044b \u043a\u043b\u0438\u043a\u0430\u0435\u0442\u0435 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u0442\u0435 CSS-\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u044f\u043c\u043e \u0432 \u043f\u0430\u043d\u0435\u043b\u0438, \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. Vite HMR \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u2014 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/p>\n<pre><code class=\"\">\u041a\u043b\u0438\u043a \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u2192 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2192 Vite HMR \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u2192 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:87px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u043f\u0438-\u043f\u0430\u0441\u0442\u0430. \u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432\u043a\u043b\u0430\u0434\u043e\u043a.<\/p>\n<h3>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442<\/h3>\n<pre><code class=\"bash\">npm install livestylesync-overlay livestylesync-vite-plugin<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<pre><code class=\"ts\">\/\/ vite.config.tsimport { liveStyleSync } from \"livestylesync-vite-plugin\";\u200bexport default defineConfig({ \u00a0plugins: [liveStyleSync()],});<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<pre><code class=\"ts\">\/\/ main.tsimport { mount } from \"livestylesync-overlay\";\u200bif (import.meta.env.DEV) { \u00a0mount();}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0412\u0441\u0451. \u041f\u0430\u043d\u0435\u043b\u044c \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0432 \u0443\u0433\u043b\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u0437\u043d\u0443\u0442\u0440\u0438<\/h3>\n<h4>\u041c\u043e\u0441\u0442 \u043c\u0435\u0436\u0434\u0443 CSSOM \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c<\/h4>\n<p>\u042d\u0442\u043e \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0411\u0440\u0430\u0443\u0437\u0435\u0440 \u0437\u043d\u0430\u0435\u0442 CSS-\u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043a\u0430\u043a\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043e\u043d\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043e. \u041d\u0443\u0436\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u0442\u044c <code>document.styleSheets<\/code> \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c <code>.css<\/code> \u0438\u043b\u0438 <code>.scss<\/code> \u0444\u0430\u0439\u043b\u043e\u043c \u043d\u0430 \u0434\u0438\u0441\u043a\u0435.<\/p>\n<p>\u0423 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>CSSStyleSheet<\/code> \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u0443\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a:<\/p>\n<p><strong>\u0421\u043b\u0443\u0447\u0430\u0439 1 \u2014 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0444\u0430\u0439\u043b.<\/strong> \u0415\u0441\u043b\u0438 CSS \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d \u0447\u0435\u0440\u0435\u0437 <code>&lt;link&gt;<\/code>, \u0443 \u043b\u0438\u0441\u0442\u0430 \u0435\u0441\u0442\u044c <code>sheet.href<\/code> \u0432\u0438\u0434\u0430 <a href=\"http:\/\/localhost:5173\/src\/styles.css\" rel=\"noopener noreferrer nofollow\"><code>http:\/\/localhost:5173\/src\/styles.css<\/code><\/a>. \u0418\u0437 \u044d\u0442\u043e\u0433\u043e URL \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u043f\u0443\u0442\u044c.<\/p>\n<p><strong>\u0421\u043b\u0443\u0447\u0430\u0439 2 \u2014 <\/strong><code><strong>&lt;style&gt;<\/strong><\/code><strong> \u0442\u0435\u0433.<\/strong> SCSS, CSS Modules, Vue scoped \u2014 Vite \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u0438\u0445 \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u0430\u043a <code>&lt;style&gt;<\/code> \u0442\u0435\u0433\u0438 \u043f\u0440\u044f\u043c\u043e \u0432 <code>&lt;head&gt;<\/code>. \u0423 \u0442\u0430\u043a\u0438\u0445 \u0442\u0435\u0433\u043e\u0432 <code>href<\/code> \u0440\u0430\u0432\u0435\u043d null. \u041d\u043e Vite \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>data-vite-dev-id<\/code> \u0441 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0443:<\/p>\n<pre><code class=\"html\">&lt;style type=\"text\/css\" data-vite-dev-id=\"\/home\/user\/project\/src\/styles.scss\"&gt; \u00a0.card { background: #1a1a2e; }&lt;\/style&gt;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041a\u043e\u0434 \u0432 \u043e\u0432\u0435\u0440\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442:<\/p>\n<pre><code class=\"ts\">for (const sheet of Array.from(document.styleSheets)) { \u00a0let fileUrl = sheet.href; \/\/ \u0434\u043b\u044f &lt;link&gt; \u0442\u0435\u0433\u043e\u0432\u200b \u00a0if (!fileUrl &amp;&amp; sheet.ownerNode instanceof HTMLElement) { \u00a0 \u00a0fileUrl = sheet.ownerNode.getAttribute(\"data-vite-dev-id\"); \/\/ \u0434\u043b\u044f &lt;style&gt; \u0442\u0435\u0433\u043e\u0432  }\u200b \u00a0if (!fileUrl) continue; \/\/ cross-origin \u0438\u043b\u0438 \u0431\u0435\u0437 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u2014 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0438\u0432 <code>fileUrl<\/code>, \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u0434\u0432\u0430 \u0438\u0437 \u0442\u0440\u0451\u0445 \u043d\u0443\u0436\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442: \u0444\u0430\u0439\u043b \u0438 CSS-\u043f\u0440\u0430\u0432\u0438\u043b\u043e (\u0438\u0437 CSSOM). \u0422\u0440\u0435\u0442\u044c\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 \u2014 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0432 \u0444\u0430\u0439\u043b\u0435 \u2014 \u044d\u0442\u043e \u0443\u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0430 PostCSS \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n<h4>\u041f\u043e\u0447\u0435\u043c\u0443 PostCSS, \u0430 \u043d\u0435 regex<\/h4>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435, \u043e \u0447\u0451\u043c \u0434\u0443\u043c\u0430\u0435\u0448\u044c \u2014 \u043d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0443 \u0438\u043b\u0438 <code>string.replace<\/code>. \u042d\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c.<\/p>\n<p><strong>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 1: \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430\u0445.<\/strong><\/p>\n<p>CSS \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <code>:<\/code> \u0432 \u0442\u0440\u0451\u0445 \u043d\u0435\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445: \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430\u0445 (<code>.foo:hover<\/code>), \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 (<code>content: \"a: b\"<\/code>), \u0441\u0430\u043c\u0438\u0445 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f\u0445 (<code>color: red<\/code>). Regex \u043f\u043e <code>color:<\/code> \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u043d\u0435 \u0442\u0443\u0434\u0430.<\/p>\n<p><strong>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 2: \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.<\/strong><\/p>\n<p>\u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0439 CSS \u0431\u044b\u0432\u0430\u0435\u0442 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445:<\/p>\n<pre><code class=\"css\">\/* \u0432\u0430\u0440\u0438\u0430\u043d\u0442 1 *\/.card { background: #fff; }\u200b\/* \u0432\u0430\u0440\u0438\u0430\u043d\u0442 2 *\/.card { \u00a0background: #fff;}\u200b\/* \u0432\u0430\u0440\u0438\u0430\u043d\u0442 3 \u2014 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u043c *\/.card { \u00a0background: #fff; \/* default *\/}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>Regex \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u043b\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u2014 \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0443\u0448\u0430\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.<\/p>\n<p><strong>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 3: SCSS-\u043d\u0435\u0441\u0442\u0438\u043d\u0433 \u0438 @media \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430.<\/strong><\/p>\n<pre><code class=\"scss\">.card { \u00a0background: #fff;\u200b \u00a0@media (max-width: 768px) { \u00a0 \u00a0background: #000;  }\u200b  &amp;:hover { \u00a0 \u00a0background: #eee;  }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u043e\u0439 \u2014 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e. \u041d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c, \u043d\u0430 \u043a\u0430\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f.<\/p>\n<p>PostCSS \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u0432 AST. \u041a\u0430\u0436\u0434\u044b\u0439 \u0443\u0437\u0435\u043b \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f: <code>Rule<\/code> (\u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440), <code>Declaration<\/code> (\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435), <code>AtRule<\/code> (@media, @container). \u041d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <code>Rule<\/code> \u0441 \u043d\u0443\u0436\u043d\u044b\u043c <code>selector<\/code>, \u0432 \u043d\u0451\u043c \u043d\u0430\u0439\u0442\u0438 <code>Declaration<\/code> \u0441 \u043d\u0443\u0436\u043d\u044b\u043c <code>prop<\/code> \u2014 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c <code>value<\/code>. \u0412\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 (\u043e\u0442\u0441\u0442\u0443\u043f\u044b, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u044b \u0441\u0442\u0440\u043e\u043a) PostCSS \u0445\u0440\u0430\u043d\u0438\u0442 \u0432 <code>raws<\/code> \u0438 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 <code>toString()<\/code>.<\/p>\n<pre><code class=\"ts\">root.walkRules((rule) =&gt; { \u00a0if (rule.selector !== targetSelector) return; \u00a0rule.walkDecls(prop, (decl) =&gt; { \u00a0 \u00a0decl.value = newValue; \/\/ \u043c\u0435\u043d\u044f\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0432\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0435\u043c  });});writeFileSync(filePath, root.toString()); \/\/ \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043e<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0414\u043b\u044f SCSS \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>postcss-scss<\/code> \u2014 \u043e\u043d \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 SCSS \u0432\u043a\u043b\u044e\u0447\u0430\u044f <code>$variables<\/code>, \u043d\u0435\u0441\u0442\u0438\u043d\u0433 \u0438 \u043c\u0438\u043a\u0441\u0438\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 PostCSS \u043d\u0435 \u043f\u0430\u0440\u0441\u0438\u0442.<\/p>\n<h4>HMR: \u043e\u0442 setTimeout \u043a \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044e<\/h4>\n<p>\u041f\u0435\u0440\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u0442\u0430\u043a: \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0430\u0442\u0447\u0430 \u043f\u043e WebSocket \u0436\u0434\u0430\u0442\u044c 400 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434, \u043f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c CSSOM.<\/p>\n<pre><code class=\"ts\">send({ fileUrl, selector, prop, value });setTimeout(() =&gt; editor.refresh(), 400); \/\/ \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u0430 Vite \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0430\u0433\u043e\u0432 \u2014 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 watcher \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435, Vite \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 HMR-\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 \u0441\u0432\u043e\u0439 WebSocket, \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 CSS. \u042d\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0440\u0430\u0437\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0444\u0430\u0439\u043b\u0430 \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u041d\u0430 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445 400 \u043c\u0441 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e \u0438 \u043e\u0432\u0435\u0440\u043b\u0435\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0439 CSSOM. \u041d\u0430 \u0431\u044b\u0441\u0442\u0440\u044b\u0445 \u2014 \u0437\u0440\u044f \u0436\u0434\u0430\u043b.<\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u0430. \u041a\u043b\u0438\u0435\u043d\u0442 \u0436\u0434\u0451\u0442 \u044d\u0442\u043e\u0442 \u0441\u0438\u0433\u043d\u0430\u043b, \u0430 \u043d\u0435 \u0442\u0430\u0439\u043c\u0435\u0440.<\/p>\n<pre><code class=\"ts\">\/\/ \u0441\u0435\u0440\u0432\u0435\u0440 \u2014 \u043f\u043e\u0441\u043b\u0435 writeFileSync:socket.send(JSON.stringify({ type: \"patched\" }));\u200b\/\/ \u043a\u043b\u0438\u0435\u043d\u0442:if (msg.type === \"patched\") { \u00a0setTimeout(() =&gt; editor.refresh(), 300); \/\/ \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0431\u0443\u0444\u0435\u0440 \u0434\u043b\u044f HMR}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c 300 \u043c\u0441 \u043e\u0442\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0433\u0434\u0430 \u0444\u0430\u0439\u043b \u0443\u0436\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u2014 \u0430 \u043d\u0435 \u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u043d\u043e \u043f\u0440\u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u043c \u0434\u0438\u0441\u043a\u0435 \u0438\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u043c SCSS-\u0444\u0430\u0439\u043b\u0435 \u044d\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<h4>\u041f\u0441\u0435\u0432\u0434\u043e-\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f: \u043a\u0430\u043a \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c :hover \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0430\u043a\u0442\u0438\u0432\u0435\u043d<\/h4>\n<p>\u0411\u0440\u0430\u0443\u0437\u0435\u0440 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u043e <code>.button:hover { color: red }<\/code> \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u044b\u0448\u044c \u043d\u0430\u0434 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, <code>el.matches(\".button:hover\")<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>false<\/code> \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043a\u043b\u0438\u043a\u043d\u0443\u043b\u0438.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 <code>matches<\/code>, \u0432\u0441\u0435 \u043f\u0441\u0435\u0432\u0434\u043e-\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432\u044b\u043f\u0430\u0434\u0443\u0442 \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e hover\/focus\/active \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 \u043f\u0430\u043d\u0435\u043b\u0438.<\/p>\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0434\u0432\u0443\u0445\u0448\u0430\u0433\u043e\u0432\u044b\u0439 \u043c\u0430\u0442\u0447\u0438\u043d\u0433. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043c\u0430\u0442\u0447 \u043a\u0430\u043a \u0435\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 \u043d\u0435 \u043f\u0440\u043e\u0448\u0451\u043b \u0438 \u0432 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0435 \u0435\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u0441\u0435\u0432\u0434\u043e-\u043a\u043b\u0430\u0441\u0441 \u2014 strip \u0435\u0433\u043e \u0438 \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043d\u043e\u0432\u0430:<\/p>\n<pre><code class=\"ts\">const INTERACTIVE_PSEUDOS = [\":hover\", \":focus\", \":active\", \":checked\", \/* ... *\/];\u200bfunction stripInteractivePseudos(selector: string): string { \u00a0let s = selector; \u00a0for (const p of INTERACTIVE_PSEUDOS) { \u00a0 \u00a0s = s.split(p).join(\"\"); \/\/ \u0443\u0431\u0438\u0440\u0430\u0435\u043c \":hover\" \u0438\u0437 \".button:hover\"  } \u00a0return s.trim(); \/\/ \".button\"}\u200b\/\/ \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u0435 \u043f\u0440\u0430\u0432\u0438\u043b:let matches = el.matches(effectiveSelector);if (!matches &amp;&amp; isPseudoRule) { \u00a0matches = el.matches(stripInteractivePseudos(effectiveSelector));}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p><code>.button:hover<\/code> \u2192 strip \u2192 <code>.button<\/code> \u2192 \u043c\u0430\u0442\u0447 \u043f\u0440\u043e\u0448\u0451\u043b. \u041f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u043f\u0430\u043d\u0435\u043b\u044c \u0441 \u043f\u043e\u043c\u0435\u0442\u043a\u043e\u0439, \u0447\u0442\u043e \u044d\u0442\u043e <code>:hover<\/code>-\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435.<\/p>\n<p>\u0414\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0432\u044c\u044e \u043f\u043e\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 <a href=\"http:\/\/element.style\" rel=\"noopener noreferrer nofollow\"><code>element.style<\/code><\/a><code>.setProperty()<\/code> \u2014 inline-\u0441\u0442\u0438\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0438\u0434\u043d\u043e \u0432\u0441\u0435\u0433\u0434\u0430, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0445\u043e\u0432\u0435\u0440\u0435. \u042d\u0442\u043e \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441 \u0434\u043b\u044f dev-\u0440\u0435\u0436\u0438\u043c\u0430: \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0445\u043e\u0442\u044f \u0438 \u0431\u0435\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043b\u0430\u0441\u0441\u0430.<\/p>\n<h4>Vue scoped: \u0445\u044d\u0448\u0438 \u0432 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430\u0445<\/h4>\n<p>Vue <code>&lt;style scoped&gt;<\/code> \u2014 \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u0438\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443, \u0430 \u043d\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e. Vue \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 (<code>data-v-3f7bd2<\/code>) \u0438 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 CSS-\u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043a \u043d\u0438\u043c \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442:<\/p>\n<pre><code class=\"css\">\/* \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a \u0432 .vue \u0444\u0430\u0439\u043b\u0435 *\/.card { background: #fff; }\u200b\/* \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 *\/.card[data-v-3f7bd2] { background: #fff; }<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u042d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0434\u0432\u0430 \u043d\u0435\u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043c, \u0447\u0442\u043e \u0432\u0438\u0434\u0438\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0438 \u0442\u0435\u043c, \u0447\u0442\u043e \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0435:<\/p>\n<p><strong>1. \u0421\u0435\u043b\u0435\u043a\u0442\u043e\u0440.<\/strong> CSSOM \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 <code>.card[data-v-3f7bd2]<\/code>, \u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e <code>.card<\/code>. \u0415\u0441\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 <code>.card[data-v-3f7bd2]<\/code> \u2014 PostCSS \u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0451\u0442.<\/p>\n<p><strong>2. URL \u0444\u0430\u0439\u043b\u0430.<\/strong> Vite \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 Vue-\u0441\u0442\u0438\u043b\u0438 \u043f\u043e\u0434 URL \u0432\u0438\u0434\u0430 <code>main.vue?vue&amp;type=style&amp;index=0&amp;scoped=7bd2<\/code>. \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>main.vue<\/code>.<\/p>\n<p>\u041e\u0431\u0430 \u0441\u043b\u0443\u0447\u0430\u044f \u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439:<\/p>\n<pre><code class=\"ts\">\/\/ \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0445\u044d\u0448 \u0438\u0437 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430const selector = effectiveSelector  .replace(\/\\[data-v-[a-f0-9]+\\]\/g, \"\")  .trim(); \/\/ \".card[data-v-3f7bd2]\" \u2192 \".card\"\u200b\/\/ \u0443\u0431\u0438\u0440\u0430\u0435\u043c query-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437 URLconst isVue = fileUrl.includes(\"?vue&amp;type=style\");const cleanUrl = isVue ? fileUrl.split(\"?\")[0] : fileUrl; \/\/ \u2192 \"main.vue\"<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 <code>patchVue<\/code> \u043f\u0430\u0440\u0441\u0438\u0442 <code>.vue<\/code> \u0444\u0430\u0439\u043b \u043a\u0430\u043a \u0442\u0435\u043a\u0441\u0442, \u0432\u044b\u0447\u043b\u0435\u043d\u044f\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 <code>&lt;style&gt;<\/code> \u0431\u043b\u043e\u043a\u0430, \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0435\u0442 \u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 PostCSS, \u043d\u0430\u0445\u043e\u0434\u0438\u0442 <code>.card<\/code> \u2014 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e <code>&lt;style&gt;<\/code> \u0431\u043b\u043e\u043a, \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u044f <code>&lt;template&gt;<\/code> \u0438 <code>&lt;script&gt;<\/code>.<\/p>\n<h3>\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0433\u0440\u0430\u0431\u043b\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u043b<\/h3>\n<h4>\u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440 *<\/h4>\n<p>\u0412 <code>document.styleSheets<\/code> \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0440\u043e\u0434\u0435 <code><em>, <\/em>::before, <em>::after { box-sizing: border-box }<\/em><\/code><em>. \u0411\u0435\u0437 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u0432 \u043f\u0430\u043d\u0435\u043b\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435. \u0424\u0438\u043a\u0441 \u2014 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u0433\u0434\u0435 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u0430 \u0447\u0430\u0441\u0442\u044c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e \u0440\u0430\u0432\u043d\u0430 <\/em> \u0438\u043b\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 <code>*:<\/code>:<\/p>\n<pre><code class=\"ts\">const selParts = selector.split(\",\").map((s) =&gt; s.trim());if (selParts.some((p) =&gt; p === \"*\" || p.startsWith(\"*:\"))) continue;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>CSSContainerRule \u043d\u0435\u0442 \u0432 TypeScript lib<\/h4>\n<p><code>@container<\/code> \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 TypeScript \u043d\u0435 \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435. <code>instanceof CSSContainerRule<\/code> \u2014 \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 duck-typing: \u0443 <code>@container<\/code> \u0435\u0441\u0442\u044c <code>conditionText<\/code>, \u043d\u043e \u043d\u0435\u0442 <code>instanceof CSSMediaRule<\/code>:<\/p>\n<pre><code class=\"ts\">if ( \u00a0!(rule instanceof CSSMediaRule) &amp;&amp; \u00a0!(rule instanceof CSSSupportsRule) &amp;&amp;  (rule as any).conditionText !== undefined) { \u00a0\/\/ \u044d\u0442\u043e @container}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>Inline-\u0441\u0442\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u043e\u0442\u043a\u0430\u0442<\/h4>\n<p>\u041f\u0440\u0438 \u043e\u0442\u043a\u0430\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0441\u0442\u0438\u043b\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b\u0438\u0441\u044c \u0432 \u0444\u0430\u0439\u043b, \u043d\u043e <code>(element as HTMLElement).style<\/code> \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0441\u044f \u0441 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c\u0438 inline-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u043b\u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430. CSS-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u044c: inline-\u0441\u0442\u0438\u043b\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u0431\u0435\u0436\u0434\u0430\u044e\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u0442\u0438\u043b\u0435\u0439.<\/p>\n<p>\u0424\u0438\u043a\u0441 \u2014 \u044f\u0432\u043d\u043e \u043e\u0447\u0438\u0449\u0430\u0442\u044c inline-\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u0438 \u043e\u0442\u043a\u0430\u0442\u0435:<\/p>\n<pre><code class=\"ts\">(selected as HTMLElement).style.setProperty(prop, oldValue);\/\/ \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 oldValue \u043f\u0443\u0441\u0442\u043e\u0439:(selected as HTMLElement).style.removeProperty(prop);<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<h4>\u0414\u0432\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 undo \u0440\u0430\u0437\u044a\u0435\u0445\u0430\u043b\u0438\u0441\u044c<\/h4>\n<p>\u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0443 \u043c\u0435\u043d\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0434\u0432\u0430 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0441\u0442\u0435\u043a\u0430 \u043e\u0442\u043c\u0435\u043d\u044b: \u043e\u0434\u0438\u043d \u0432\u043d\u0443\u0442\u0440\u0438 <code>useStyleEditor<\/code> (\u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f CSS), \u0432\u0442\u043e\u0440\u043e\u0439 \u0432 \u043e\u0431\u0449\u0435\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0441\u0435\u0441\u0441\u0438\u0438 (CSS + SCSS \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 + CSS custom properties). \u041f\u0440\u0438 \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u043e\u043d\u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. \u042d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0431\u0430\u0433, \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u044e \u043f\u043e\u0434 \u0435\u0434\u0438\u043d\u044b\u0439 \u0441\u0442\u0435\u043a.<\/p>\n<h3>\u0427\u0442\u043e \u0443\u043c\u0435\u0435\u0442<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0424\u0438\u0447\u0430<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Element picker<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041a\u043b\u0438\u043a \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u041f\u043e\u0438\u0441\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041f\u043e\u0438\u0441\u043a \u043f\u043e <code>.class<\/code>, <code>#id<\/code>, CSS-\u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0443 \u0441 \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u043e\u0439<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>DOM breadcrumbs<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u043f\u043e \u043f\u0440\u0435\u0434\u043a\u0430\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>@media \u0438 @container<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u043a\u043b\u0430\u0434\u043a\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u0440\u0435\u0439\u043a\u043f\u043e\u0438\u043d\u0442\u0430\/\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u041f\u0441\u0435\u0432\u0434\u043e-\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 <code>:hover<\/code>, <code>:focus<\/code>, <code>:active<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>CSS custom properties<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0411\u0440\u0430\u0443\u0437\u0435\u0440 \u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 <code>:root<\/code> \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>SCSS $\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0421\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 \u0441\u043a\u0430\u043d \u0432\u0441\u0435\u0445 <code>.scss<\/code> \u0444\u0430\u0439\u043b\u043e\u0432, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 <code>$var<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c CSS \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443, \u0443 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435\u0442 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>\u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0441\u0435\u0441\u0441\u0438\u0438<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">Git-style \u0434\u0438\u0444\u0444\u044b \u0432\u0441\u0435\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439, \u043e\u0442\u043a\u0430\u0442 \u0431\u0430\u0442\u0447\u0430\u043c\u0438<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><strong>Tailwind detection<\/strong><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043f\u0430\u0442\u0447\u0438\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u044b<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432 CSS<\/h3>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<th>\n<p align=\"left\">\u0424\u043e\u0440\u043c\u0430\u0442<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u0427\u0442\u0435\u043d\u0438\u0435<\/p>\n<\/th>\n<th>\n<p align=\"left\">\u041f\u0430\u0442\u0447<\/p>\n<\/th>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">\u041e\u0431\u044b\u0447\u043d\u044b\u0439 <code>.css<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2705<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\"><code>.scss<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2705<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">CSS Modules <code>.module.css<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2705<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Vue <code>&lt;style scoped&gt;<\/code><\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2705<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2705<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Tailwind-\u0443\u0442\u0438\u043b\u0438\u0442\u044b<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u26a0\ufe0f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0430\u0435\u0442<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2014<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"left\">Inline styles<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u274c<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u2014<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 \u043b\u044e\u0431\u044b\u043c \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c \u043d\u0430 Vite<\/h3>\n<p>React, Vue, Nuxt, SvelteKit, Astro, Solid \u2014 \u0432\u0441\u0451, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Vite \u043a\u0430\u043a dev-\u0441\u0435\u0440\u0432\u0435\u0440. \u041e\u0432\u0435\u0440\u043b\u0435\u0439 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 peer-\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 React: Preact \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u044c \u0431\u0430\u043d\u0434\u043b\u0430 \u0438 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d \u043e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u0421\u0442\u0435\u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h3>\n<ul>\n<li>\n<p><strong>\u041c\u043e\u043d\u043e\u0440\u0435\u043f\u043e<\/strong> \u043d\u0430 pnpm workspaces<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0432\u0435\u0440\u043b\u0435\u0439<\/strong> \u2014 Preact + TypeScript, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 tsup \u0432 \u043e\u0434\u0438\u043d \u0444\u0430\u0439\u043b \u0431\u0435\u0437 \u0432\u043d\u0435\u0448\u043d\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439<\/p>\n<\/li>\n<li>\n<p><strong>Vite-\u043f\u043b\u0430\u0433\u0438\u043d<\/strong> \u2014 Node.js + <code>ws<\/code> (WebSocket) + PostCSS + postcss-scss<\/p>\n<\/li>\n<li>\n<p><strong>\u0422\u0435\u0441\u0442\u044b<\/strong> \u2014 Vitest \u0434\u043b\u044f \u043f\u0430\u0442\u0447\u0435\u0440\u043e\u0432 (CSS\/SCSS\/Vue)<\/p>\n<\/li>\n<\/ul>\n<h3>\u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c<\/h3>\n<p><strong>GitHub:<\/strong> <a href=\"https:\/\/github.com\/Artyx71\/livestylesync\" rel=\"noopener noreferrer nofollow\">https:\/\/github.com\/Artyx71\/livestylesync<\/a><\/p>\n<pre><code class=\"bash\">npm install livestylesync-overlay livestylesync-vite-plugin<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><img style=\"width:14px;height:14px;object-fit:cover;object-position:left;\"\/><\/a><\/div><\/pre>\n<p>\u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u0444\u0438\u0434\u0431\u044d\u043a\u0443 \u2014 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0435\u0441\u043b\u0438 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u0442\u0435 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u043c \u043e\u0442 React, \u0438\u043b\u0438 \u043d\u0430\u0442\u043a\u043d\u0451\u0442\u0435\u0441\u044c \u043d\u0430 \u043a\u0435\u0439\u0441 \u0441 \u043d\u0435\u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 CSS. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0439\u0442\u0435 issue \u0438\u043b\u0438 \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438.<\/p>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1041454\/\">https:\/\/habr.com\/ru\/articles\/1041454\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u042d\u0442\u043e \u043c\u043e\u044f \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0430 \u0425\u0430\u0431\u0440\u0435. \u0411\u0443\u0434\u0443 \u0440\u0430\u0434 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043a\u0440\u0438\u0442\u0438\u043a\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.\u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u044f \u0445\u043e\u0442\u0435\u043b \u043f\u043e\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0441\u0442\u0443\u043f \u0438\u043b\u0438 \u0446\u0432\u0435\u0442 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u044f \u0434\u0435\u043b\u0430\u043b \u043e\u0434\u043d\u043e \u0438 \u0442\u043e \u0436\u0435:\u043e\u0442\u043a\u0440\u044b\u043b DevTools \u2192 \u043d\u0430\u0448\u0451\u043b \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u2192 \u043f\u043e\u043c\u0435\u043d\u044f\u043b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2192 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u2192 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043b \u2192 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u2192 \u043d\u0430\u0448\u0451\u043b \u0444\u0430\u0439\u043b \u2192 \u0432\u0441\u0442\u0430\u0432\u0438\u043b.\u042d\u0442\u043e \u0441\u0435\u043c\u044c \u0448\u0430\u0433\u043e\u0432 \u0440\u0430\u0434\u0438 \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f. \u042f \u0441\u0434\u0435\u043b\u0430\u043b LiveStyleSync, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0431\u044b\u043b \u043e\u0434\u0438\u043d \u0448\u0430\u0433.\u0427\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435LiveStyleSync \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u0430\u043d\u0435\u043b\u044c \u043f\u043e\u0432\u0435\u0440\u0445 \u0432\u0430\u0448\u0435\u0433\u043e Vite-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u0412\u044b \u043a\u043b\u0438\u043a\u0430\u0435\u0442\u0435 \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u0442\u0435 CSS-\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043f\u0440\u044f\u043c\u043e \u0432 \u043f\u0430\u043d\u0435\u043b\u0438, \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0444\u0430\u0439\u043b. Vite HMR \u043f\u043e\u0434\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u2014 \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.\u041a\u043b\u0438\u043a \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u2192 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2192 Vite HMR \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u2192 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a \u043e\u0431\u043d\u043e\u0432\u043b\u0451\u043d\u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u043f\u0438-\u043f\u0430\u0441\u0442\u0430. \u041d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0432\u043a\u043b\u0430\u0434\u043e\u043a.\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0442\u0430\u0440\u0442npm install livestylesync-overlay livestylesync-vite-plugin\/\/ vite.config.tsimport { liveStyleSync } from &#171;livestylesync-vite-plugin&#187;;\u200bexport default defineConfig({ \u00a0plugins: [liveStyleSync()],});\/\/ main.tsimport { mount } from &#171;livestylesync-overlay&#187;;\u200bif (import.meta.env.DEV) { \u00a0mount();}\u0412\u0441\u0451. \u041f\u0430\u043d\u0435\u043b\u044c \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0432 \u0443\u0433\u043b\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0438\u0437\u043d\u0443\u0442\u0440\u0438\u041c\u043e\u0441\u0442 \u043c\u0435\u0436\u0434\u0443 CSSOM \u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c\u042d\u0442\u043e \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435. \u0411\u0440\u0430\u0443\u0437\u0435\u0440 \u0437\u043d\u0430\u0435\u0442 CSS-\u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u043d\u043e \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u0432 \u043a\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043a\u0430\u043a\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 \u043e\u043d\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043e. \u041d\u0443\u0436\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u0442\u044c document.styleSheets \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c .css \u0438\u043b\u0438 .scss \u0444\u0430\u0439\u043b\u043e\u043c \u043d\u0430 \u0434\u0438\u0441\u043a\u0435.\u0423 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 CSSStyleSheet \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043f\u0443\u0442\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a:\u0421\u043b\u0443\u0447\u0430\u0439 1 \u2014 \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0444\u0430\u0439\u043b. \u0415\u0441\u043b\u0438 CSS \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0451\u043d \u0447\u0435\u0440\u0435\u0437 &lt;link&gt;, \u0443 \u043b\u0438\u0441\u0442\u0430 \u0435\u0441\u0442\u044c sheet.href \u0432\u0438\u0434\u0430 http:\/\/localhost:5173\/src\/styles.css. \u0418\u0437 \u044d\u0442\u043e\u0433\u043e URL \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u043f\u0443\u0442\u044c.\u0421\u043b\u0443\u0447\u0430\u0439 2 \u2014 &lt;style&gt; \u0442\u0435\u0433. SCSS, CSS Modules, Vue scoped \u2014 Vite \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u0438\u0445 \u0438 \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u0430\u043a &lt;style&gt; \u0442\u0435\u0433\u0438 \u043f\u0440\u044f\u043c\u043e \u0432 &lt;head&gt;. \u0423 \u0442\u0430\u043a\u0438\u0445 \u0442\u0435\u0433\u043e\u0432 href \u0440\u0430\u0432\u0435\u043d null. \u041d\u043e Vite \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 data-vite-dev-id \u0441 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u043c \u043f\u0443\u0442\u0451\u043c \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0443:&lt;style type=&#187;text\/css&#187; data-vite-dev-id=&#187;\/home\/user\/project\/src\/styles.scss&#187;&gt; \u00a0.card { background: #1a1a2e; }&lt;\/style&gt;\u041a\u043e\u0434 \u0432 \u043e\u0432\u0435\u0440\u043b\u0435\u0435 \u0447\u0438\u0442\u0430\u0435\u0442 \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442:for (const sheet of Array.from(document.styleSheets)) { \u00a0let fileUrl = sheet.href; \/\/ \u0434\u043b\u044f &lt;link&gt; \u0442\u0435\u0433\u043e\u0432\u200b \u00a0if (!fileUrl &amp;&amp; sheet.ownerNode instanceof HTMLElement) { \u00a0 \u00a0fileUrl = sheet.ownerNode.getAttribute(&#171;data-vite-dev-id&#187;); \/\/ \u0434\u043b\u044f &lt;style&gt; \u0442\u0435\u0433\u043e\u0432  }\u200b \u00a0if (!fileUrl) continue; \/\/ cross-origin \u0438\u043b\u0438 \u0431\u0435\u0437 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u2014 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c}\u041f\u043e\u043b\u0443\u0447\u0438\u0432 fileUrl, \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u0434\u0432\u0430 \u0438\u0437 \u0442\u0440\u0451\u0445 \u043d\u0443\u0436\u043d\u044b\u0445 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442: \u0444\u0430\u0439\u043b \u0438 CSS-\u043f\u0440\u0430\u0432\u0438\u043b\u043e (\u0438\u0437 CSSOM). \u0422\u0440\u0435\u0442\u044c\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 \u2014 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0432 \u0444\u0430\u0439\u043b\u0435 \u2014 \u044d\u0442\u043e \u0443\u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0430 PostCSS \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.\u041f\u043e\u0447\u0435\u043c\u0443 PostCSS, \u0430 \u043d\u0435 regex\u041f\u0435\u0440\u0432\u043e\u0435, \u043e \u0447\u0451\u043c \u0434\u0443\u043c\u0430\u0435\u0448\u044c \u2014 \u043d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u0443 \u0438\u043b\u0438 string.replace. \u042d\u0442\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c.\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 1: \u0434\u0432\u043e\u0435\u0442\u043e\u0447\u0438\u0435 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430\u0445.CSS \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 : \u0432 \u0442\u0440\u0451\u0445 \u043d\u0435\u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0441\u0442\u0430\u0445: \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430\u0445 (.foo:hover), \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 (content: &#171;a: b&#187;), \u0441\u0430\u043c\u0438\u0445 \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f\u0445 (color: red). Regex \u043f\u043e color: \u043f\u043e\u043f\u0430\u0434\u0451\u0442 \u043d\u0435 \u0442\u0443\u0434\u0430.\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 2: \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.\u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0439 CSS \u0431\u044b\u0432\u0430\u0435\u0442 \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445:\/* \u0432\u0430\u0440\u0438\u0430\u043d\u0442 1 *\/.card { background: #fff; }\u200b\/* \u0432\u0430\u0440\u0438\u0430\u043d\u0442 2 *\/.card { \u00a0background: #fff;}\u200b\/* \u0432\u0430\u0440\u0438\u0430\u043d\u0442 3 \u2014 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u043c *\/.card { \u00a0background: #fff; \/* default *\/}Regex \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u043b\u0438 \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u2014 \u0447\u0442\u043e \u0440\u0430\u0437\u0440\u0443\u0448\u0430\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435.\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 3: SCSS-\u043d\u0435\u0441\u0442\u0438\u043d\u0433 \u0438 @media \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430..card { \u00a0background: #fff;\u200b \u00a0@media (max-width: 768px) { \u00a0 \u00a0background: #000;  }\u200b  &amp;:hover { \u00a0 \u00a0background: #eee;  }}\u041d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u043e\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043a\u043e\u0439 \u2014 \u043d\u0435\u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e. \u041d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c, \u043d\u0430 \u043a\u0430\u043a\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0434\u0435\u043a\u043b\u0430\u0440\u0430\u0446\u0438\u044f.PostCSS \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u0442 \u0444\u0430\u0439\u043b \u0432 AST. \u041a\u0430\u0436\u0434\u044b\u0439 \u0443\u0437\u0435\u043b \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f: Rule (\u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440), Declaration (\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435), AtRule (@media, @container). \u041d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 Rule \u0441 \u043d\u0443\u0436\u043d\u044b\u043c selector, \u0432 \u043d\u0451\u043c \u043d\u0430\u0439\u0442\u0438 Declaration \u0441 \u043d\u0443\u0436\u043d\u044b\u043c prop \u2014 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c value. \u0412\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 (\u043e\u0442\u0441\u0442\u0443\u043f\u044b, \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438, \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u044b \u0441\u0442\u0440\u043e\u043a) PostCSS \u0445\u0440\u0430\u043d\u0438\u0442 \u0432 raws \u0438 \u0432\u043e\u0441\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442 \u043f\u0440\u0438 toString().root.walkRules((rule) =&gt; { \u00a0if (rule.selector !== targetSelector) return; \u00a0rule.walkDecls(prop, (decl) =&gt; { \u00a0 \u00a0decl.value = newValue; \/\/ \u043c\u0435\u043d\u044f\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0432\u0441\u0451 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u0435\u043c  });});writeFileSync(filePath, root.toString()); \/\/ \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043e\u0414\u043b\u044f SCSS \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f postcss-scss \u2014 \u043e\u043d \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 SCSS \u0432\u043a\u043b\u044e\u0447\u0430\u044f $variables, \u043d\u0435\u0441\u0442\u0438\u043d\u0433 \u0438 \u043c\u0438\u043a\u0441\u0438\u043d\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 PostCSS \u043d\u0435 \u043f\u0430\u0440\u0441\u0438\u0442.HMR: \u043e\u0442 setTimeout \u043a \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044e\u041f\u0435\u0440\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u0430 \u0442\u0430\u043a: \u043f\u043e\u0441\u043b\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0430\u0442\u0447\u0430 \u043f\u043e WebSocket \u0436\u0434\u0430\u0442\u044c 400 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434, \u043f\u043e\u0442\u043e\u043c \u043f\u0435\u0440\u0435\u0447\u0438\u0442\u0430\u0442\u044c CSSOM.send({ fileUrl, selector, prop, value });setTimeout(() =&gt; editor.refresh(), 400); \/\/ \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430: \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u0430 Vite \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0430\u0433\u043e\u0432 \u2014 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 watcher \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0432\u0430\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435, Vite \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u043c\u043e\u0434\u0443\u043b\u044c, \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 HMR-\u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 \u0441\u0432\u043e\u0439 WebSocket, \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u043d\u043e\u0432\u044b\u0439 CSS. \u042d\u0442\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442 \u0440\u0430\u0437\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0444\u0430\u0439\u043b\u0430 \u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438. \u041d\u0430 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d\u0430\u0445 400 \u043c\u0441 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e \u0438 \u043e\u0432\u0435\u0440\u043b\u0435\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0439 CSSOM. \u041d\u0430 \u0431\u044b\u0441\u0442\u0440\u044b\u0445 \u2014 \u0437\u0440\u044f \u0436\u0434\u0430\u043b.\u0420\u0435\u0448\u0435\u043d\u0438\u0435: \u0441\u0435\u0440\u0432\u0435\u0440 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u0430. \u041a\u043b\u0438\u0435\u043d\u0442 \u0436\u0434\u0451\u0442 \u044d\u0442\u043e\u0442 \u0441\u0438\u0433\u043d\u0430\u043b, \u0430 \u043d\u0435 \u0442\u0430\u0439\u043c\u0435\u0440.\/\/ \u0441\u0435\u0440\u0432\u0435\u0440 \u2014 \u043f\u043e\u0441\u043b\u0435 writeFileSync:socket.send(JSON.stringify({ type: &#171;patched&#187; }));\u200b\/\/ \u043a\u043b\u0438\u0435\u043d\u0442:if (msg.type === &#171;patched&#187;) { \u00a0setTimeout(() =&gt; editor.refresh(), 300); \/\/ \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0431\u0443\u0444\u0435\u0440 \u0434\u043b\u044f HMR}\u0422\u0435\u043f\u0435\u0440\u044c 300 \u043c\u0441 \u043e\u0442\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0433\u0434\u0430 \u0444\u0430\u0439\u043b \u0443\u0436\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u2014 \u0430 \u043d\u0435 \u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0439, \u043d\u043e \u043f\u0440\u0438 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u043e\u043c \u0434\u0438\u0441\u043a\u0435 \u0438\u043b\u0438 \u0441\u043b\u043e\u0436\u043d\u043e\u043c SCSS-\u0444\u0430\u0439\u043b\u0435 \u044d\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e.\u041f\u0441\u0435\u0432\u0434\u043e-\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f: \u043a\u0430\u043a \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c :hover \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0435 \u0430\u043a\u0442\u0438\u0432\u0435\u043d\u0411\u0440\u0430\u0443\u0437\u0435\u0440 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u043e .button:hover { color: red } \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u0435\u0440\u0436\u0438\u0442 \u043c\u044b\u0448\u044c \u043d\u0430\u0434 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, el.matches(&#171;.button:hover&#187;) \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 false \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u043a\u043b\u0438\u043a\u043d\u0443\u043b\u0438.\u0415\u0441\u043b\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0440\u0435\u0437 matches, \u0432\u0441\u0435 \u043f\u0441\u0435\u0432\u0434\u043e-\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432\u044b\u043f\u0430\u0434\u0443\u0442 \u2014 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u0442 \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e hover\/focus\/active \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 \u043f\u0430\u043d\u0435\u043b\u0438.\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u2014 \u0434\u0432\u0443\u0445\u0448\u0430\u0433\u043e\u0432\u044b\u0439 \u043c\u0430\u0442\u0447\u0438\u043d\u0433. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043c\u0430\u0442\u0447 \u043a\u0430\u043a \u0435\u0441\u0442\u044c. \u0415\u0441\u043b\u0438 \u043d\u0435 \u043f\u0440\u043e\u0448\u0451\u043b \u0438 \u0432 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0435 \u0435\u0441\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043f\u0441\u0435\u0432\u0434\u043e-\u043a\u043b\u0430\u0441\u0441 \u2014 strip \u0435\u0433\u043e \u0438 \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u043d\u043e\u0432\u0430:const INTERACTIVE_PSEUDOS = [&#171;:hover&#187;, &#171;:focus&#187;, &#171;:active&#187;, &#171;:checked&#187;, \/* &#8230; *\/];\u200bfunction stripInteractivePseudos(selector: string): string { \u00a0let s = selector; \u00a0for (const p of INTERACTIVE_PSEUDOS) { \u00a0 \u00a0s = s.split(p).join(&#171;&#187;); \/\/ \u0443\u0431\u0438\u0440\u0430\u0435\u043c &#171;:hover&#187; \u0438\u0437 &#171;.button:hover&#187;  } \u00a0return s.trim(); \/\/ &#171;.button&#187;}\u200b\/\/ \u043f\u0440\u0438 \u0441\u0431\u043e\u0440\u0435 \u043f\u0440\u0430\u0432\u0438\u043b:let matches = el.matches(effectiveSelector);if (!matches &amp;&amp; isPseudoRule) { \u00a0matches = el.matches(stripInteractivePseudos(effectiveSelector));}.button:hover \u2192 strip \u2192 .button \u2192 \u043c\u0430\u0442\u0447 \u043f\u0440\u043e\u0448\u0451\u043b. \u041f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u043f\u0430\u043d\u0435\u043b\u044c \u0441 \u043f\u043e\u043c\u0435\u0442\u043a\u043e\u0439, \u0447\u0442\u043e \u044d\u0442\u043e :hover-\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435.\u0414\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0432\u044c\u044e \u043f\u043e\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434: \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 element.style.setProperty() \u2014 inline-\u0441\u0442\u0438\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0438\u0434\u043d\u043e \u0432\u0441\u0435\u0433\u0434\u0430, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u0445\u043e\u0432\u0435\u0440\u0435. \u042d\u0442\u043e \u043a\u043e\u043c\u043f\u0440\u043e\u043c\u0438\u0441\u0441 \u0434\u043b\u044f dev-\u0440\u0435\u0436\u0438\u043c\u0430: \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0445\u043e\u0442\u044f \u0438 \u0431\u0435\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043b\u0430\u0441\u0441\u0430.Vue scoped: \u0445\u044d\u0448\u0438 \u0432 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430\u0445Vue &lt;style scoped&gt; \u2014 \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 \u0441\u0442\u0438\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443, \u0430 \u043d\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e. Vue \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043a \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 (data-v-3f7bd2) \u0438 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 CSS-\u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043a \u043d\u0438\u043c \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442:\/* \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a \u0432 .vue \u0444\u0430\u0439\u043b\u0435 *\/.card { background: #fff; }\u200b\/* \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 *\/.card[data-v-3f7bd2] { background: #fff; }\u042d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0434\u0432\u0430 \u043d\u0435\u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043c, \u0447\u0442\u043e \u0432\u0438\u0434\u0438\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440, \u0438 \u0442\u0435\u043c, \u0447\u0442\u043e \u0432 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0435:1. \u0421\u0435\u043b\u0435\u043a\u0442\u043e\u0440. CSSOM \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 .card[data-v-3f7bd2], \u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e .card. \u0415\u0441\u043b\u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 .card[data-v-3f7bd2] \u2014 PostCSS \u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0439\u0434\u0451\u0442.2. URL \u0444\u0430\u0439\u043b\u0430. Vite \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u0442 Vue-\u0441\u0442\u0438\u043b\u0438 \u043f\u043e\u0434 URL \u0432\u0438\u0434\u0430 main.vue?vue&amp;type=style&amp;index=0&amp;scoped=7bd2. \u0420\u0435\u0430\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f main.vue.\u041e\u0431\u0430 \u0441\u043b\u0443\u0447\u0430\u044f \u0440\u0435\u0448\u0430\u044e\u0442\u0441\u044f \u043d\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439:\/\/ \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0445\u044d\u0448 \u0438\u0437 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430const selector = effectiveSelector  .replace(\/\\[data-v-[a-f0-9]+\\]\/g, &#171;&#187;)  .trim(); \/\/ &#171;.card[data-v-3f7bd2]&#187; \u2192 &#171;.card&#187;\u200b\/\/ \u0443\u0431\u0438\u0440\u0430\u0435\u043c query-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u0437 URLconst isVue = fileUrl.includes(&#171;?vue&amp;type=style&#187;);const cleanUrl = isVue ? fileUrl.split(&#171;?&#187;)[0] : fileUrl; \/\/ \u2192 &#171;main.vue&#187;\u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 patchVue \u043f\u0430\u0440\u0441\u0438\u0442 .vue \u0444\u0430\u0439\u043b \u043a\u0430\u043a \u0442\u0435\u043a\u0441\u0442, \u0432\u044b\u0447\u043b\u0435\u043d\u044f\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 &lt;style&gt; \u0431\u043b\u043e\u043a\u0430, \u043f\u0440\u043e\u0433\u043e\u043d\u044f\u0435\u0442 \u0435\u0433\u043e \u0447\u0435\u0440\u0435\u0437 PostCSS, \u043d\u0430\u0445\u043e\u0434\u0438\u0442 .card \u2014 \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e &lt;style&gt; \u0431\u043b\u043e\u043a, \u043d\u0435 \u0442\u0440\u043e\u0433\u0430\u044f &lt;template&gt; \u0438 &lt;script&gt;.\u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0433\u0440\u0430\u0431\u043b\u0438, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043d\u0430\u0441\u0442\u0443\u043f\u0438\u043b\u0423\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440 *\u0412 document.styleSheets \u0435\u0441\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0440\u043e\u0434\u0435 , ::before, ::after { box-sizing: border-box }. \u0411\u0435\u0437 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u044d\u0442\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u043e\u044f\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u0432 \u043f\u0430\u043d\u0435\u043b\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435. \u0424\u0438\u043a\u0441 \u2014 \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430, \u0433\u0434\u0435 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u0430 \u0447\u0430\u0441\u0442\u044c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e \u0440\u0430\u0432\u043d\u0430  \u0438\u043b\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 *::const selParts = selector.split(&#171;,&#187;).map((s) =&gt; s.trim());if (selParts.some((p) =&gt; p === &#171;*&#187; || p.startsWith(&#171;*:&#187;))) continue;CSSContainerRule \u043d\u0435\u0442 \u0432 TypeScript lib@container \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432 TypeScript \u043d\u0435 \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435. instanceof CSSContainerRule \u2014 \u043d\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0447\u0435\u0440\u0435\u0437 duck-typing: \u0443 @container \u0435\u0441\u0442\u044c conditionText, \u043d\u043e \u043d\u0435\u0442 instanceof CSSMediaRule:if ( \u00a0!(rule instanceof CSSMediaRule) &amp;&amp; \u00a0!(rule instanceof CSSSupportsRule) &amp;&amp;  (rule as any).conditionText !== undefined) { \u00a0\/\/ \u044d\u0442\u043e @container}Inline-\u0441\u0442\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u043e\u0442\u043a\u0430\u0442\u041f\u0440\u0438 \u043e\u0442\u043a\u0430\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0447\u0435\u0440\u0435\u0437 \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u0441\u0442\u0438\u043b\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u043b\u0438\u0441\u044c \u0432 \u0444\u0430\u0439\u043b, \u043d\u043e (element as HTMLElement).style \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0441\u044f \u0441 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c\u0438 inline-\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0435\u0440\u0435\u043a\u0440\u044b\u0432\u0430\u043b\u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430. CSS-\u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0441\u0442\u044c: inline-\u0441\u0442\u0438\u043b\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u0431\u0435\u0436\u0434\u0430\u044e\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u0442\u0438\u043b\u0435\u0439.\u0424\u0438\u043a\u0441 \u2014 \u044f\u0432\u043d\u043e \u043e\u0447\u0438\u0449\u0430\u0442\u044c inline-\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043f\u0440\u0438 \u043e\u0442\u043a\u0430\u0442\u0435:(selected as HTMLElement).style.setProperty(prop, oldValue);\/\/ \u0438\u043b\u0438 \u0435\u0441\u043b\u0438 oldValue \u043f\u0443\u0441\u0442\u043e\u0439:(selected as HTMLElement).style.removeProperty(prop);\u0414\u0432\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 undo \u0440\u0430\u0437\u044a\u0435\u0445\u0430\u043b\u0438\u0441\u044c\u0412 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u0443 \u043c\u0435\u043d\u044f \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0434\u0432\u0430 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u0441\u0442\u0435\u043a\u0430 \u043e\u0442\u043c\u0435\u043d\u044b: \u043e\u0434\u0438\u043d \u0432\u043d\u0443\u0442\u0440\u0438 useStyleEditor (\u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f CSS), \u0432\u0442\u043e\u0440\u043e\u0439 \u0432 \u043e\u0431\u0449\u0435\u0439 \u0438\u0441\u0442\u043e\u0440\u0438\u0438 \u0441\u0435\u0441\u0441\u0438\u0438 (CSS + SCSS \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 + CSS custom properties). \u041f\u0440\u0438 \u0441\u043c\u0435\u0448\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u0441\u0441\u0438\u0438 \u043e\u043d\u0438 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u043b\u0438 \u0440\u0430\u0437\u043d\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. \u042d\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u0431\u0430\u0433, \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u044e \u043f\u043e\u0434 \u0435\u0434\u0438\u043d\u044b\u0439 \u0441\u0442\u0435\u043a.\u0427\u0442\u043e \u0443\u043c\u0435\u0435\u0442\u0424\u0438\u0447\u0430\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435Element picker\u041a\u043b\u0438\u043a \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u041f\u043e\u0438\u0441\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432\u041f\u043e\u0438\u0441\u043a \u043f\u043e .class, #id,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-481671","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/481671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=481671"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/481671\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=481671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=481671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=481671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}