{"id":426880,"date":"2024-07-23T09:01:28","date_gmt":"2024-07-23T09:01:28","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=426880"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=426880","title":{"rendered":"<span>\u041c\u043e\u0439 \u0422\u041e\u041f-5 \u043b\u0443\u0447\u0448\u0438\u0445 CSS-in-JS \u0440\u0435\u0448\u0435\u043d\u0438\u0439<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><em>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/em><\/p>\n<p>\u0412\u00a0\u043e\u0434\u043d\u043e\u043c \u0438\u0437\u00a0\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e\u00a0\u0431\u044b\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0430\u0434\u043c\u0438\u043d\u043a\u0443 \u0434\u043b\u044f\u00a0\u043a\u0440\u0443\u043f\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b \u0431\u043e\u043b\u044c\u0448\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0435\u0439, \u0430\u00a0\u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0442\u0435\u043c \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0442\u0438\u043b\u0435\u0439. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u0433\u0434\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430\u00a0CSS\u2011in\u2011JS \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438 \u044d\u0442\u043e \u0434\u043b\u044f\u00a0\u043c\u0435\u043d\u044f \u0441\u0442\u0430\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435\u043c.<\/p>\n<p>\u0412\u0435\u0434\u044c \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432\u00a0\u2014 \u043e\u0441\u043d\u043e\u0432\u0430 \u0434\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0445 \u0438 \u044d\u0441\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. \u0418 \u0438\u043d\u043e\u0433\u0434\u0430 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a\u00a0CSS\u2011\u0444\u0430\u0439\u043b\u044b \u0438\u043b\u0438\u00a0\u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b, \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0441\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0447\u0435\u0433\u043e \u043c\u044b \u0442\u043e\u0447\u043d\u043e \u043d\u0435\u00a0\u0445\u043e\u0442\u0438\u043c.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u043e\u0442 \u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043d\u0430\u00a0\u043f\u043e\u043c\u043e\u0449\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f CSS\u2011in\u2011JS, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0449\u0438\u0435 \u0444\u0438\u0447\u0438 JS \u0438 CSS.<\/p>\n<p>CSS\u2011in\u2011JS\u00a0\u2014 \u044d\u0442\u043e \u043f\u043e\u0434\u0445\u043e\u0434 \u043a\u00a0\u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u0438 \u043f\u0440\u044f\u043c\u043e \u0432\u00a0JavaScript\u2011\u043a\u043e\u0434\u0435. \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430:<\/p>\n<ol>\n<li>\n<p><strong>\u0418\u0437\u043e\u043b\u044f\u0446\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439<\/strong>: \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0442\u0438\u043b\u0438<\/strong>: \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0442\u0438\u043b\u0438 \u0432\u00a0\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442\u00a0\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0438\u043b\u0438\u00a0\u043f\u0440\u043e\u043f\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0442\u0435\u043c<\/strong>: \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u0430\u043c\u0438 \u0438 \u0438\u0445 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u00a0\u043b\u0435\u0442\u0443.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441\u00a0JavaScript<\/strong>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u00a0\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b\u00a0\u0431\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0422\u041e\u041f-5\u00a0\u043b\u0443\u0447\u0448\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 CSS\u2011in\u2011JS, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b.<\/p>\n<h2>Styled Components<\/h2>\n<p>Styled Components \u2014 \u044d\u0442\u043e <strong>\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 React-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432<\/strong> \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c ES6 \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432. \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c CSS \u0432 JavaScript, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0441\u0442\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u044e\u0442 \u0441\u0432\u043e\u0438 \u0441\u0442\u0438\u043b\u0438. \u0422\u0430\u043a \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0439 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0439.<\/p>\n<p>Styled Components<strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0435\u0433\u0438<\/strong> \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f CSS \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0430\u043c\u043e\u0433\u043e JS.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e npm \u0438\u043b\u0438 yarn:<\/p>\n<pre><code class=\"bash\">npm install styled-components # \u0438\u043b\u0438 yarn add styled-components<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/strong><\/p>\n<pre><code class=\"javascript\">import styled from 'styled-components';  const Button = styled.button`   background-color: #007bff;   color: white;   border: none;   padding: 10px 20px;   border-radius: 4px;   cursor: pointer;    &amp;:hover {     background-color: #0056b3;   } `;  function App() {   return (     &lt;div>       &lt;h1>Welcome to Styled-Components!&lt;\/h1>       &lt;Button>Click me&lt;\/Button>     &lt;\/div>   ); }  export default App;<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u043b\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>Button<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 React-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441 \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u0438\u043b\u044f\u043c\u0438. <strong>\u0421\u0442\u0438\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u043f\u0441\u043e\u0432<\/strong>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u043d\u0443\u0442\u0440\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432:<\/p>\n<pre><code class=\"javascript\">const Button = styled.button`   background-color: ${props => props.primary ? '#007bff' : 'white'};   color: ${props => props.primary ? 'white' : 'black'};   \/* ... \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0438\u043b\u0438 ... *\/ `;  function App() {   return (     &lt;div>       &lt;Button primary>Primary Button&lt;\/Button>       &lt;Button>Secondary Button&lt;\/Button>     &lt;\/div>   ); }<\/code><\/pre>\n<p>Styled Components <strong>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u044e<\/strong>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>ThemeProvider<\/code>:<\/p>\n<pre><code class=\"javascript\">import { ThemeProvider } from 'styled-components';  const theme = {   primaryColor: '#007bff',   secondaryColor: '#6c757d', };  const Button = styled.button`   background-color: ${props => props.primary ? props.theme.primaryColor : props.theme.secondaryColor};   \/* ... \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0438\u043b\u0438 ... *\/ `;  function App() {   return (     &lt;ThemeProvider theme={theme}>       &lt;div>         &lt;Button primary>Primary Button&lt;\/Button>         &lt;Button>Secondary Button&lt;\/Button>       &lt;\/div>     &lt;\/ThemeProvider>   ); }  export default App;<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c<code>Button<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0442\u0435\u043c\u044b \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439.<\/p>\n<p>Styled Components \u0442\u0430\u043a\u0436\u0435 <strong>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438<\/strong> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>createGlobalStyle<\/code>:<\/p>\n<pre><code class=\"javascript\">import { createGlobalStyle } from 'styled-components';  const GlobalStyle = createGlobalStyle`   body {     font-family: 'Arial', sans-serif;     background-color: #f0f0f0;   } `;  function App() {   return (     &lt;>       &lt;GlobalStyle \/>       &lt;div>         &lt;h1>Hello, World!&lt;\/h1>       &lt;\/div>     &lt;\/>   ); }  export default App;<\/code><\/pre>\n<p><em>Styled Components \u2014 \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442. \u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0435 \u043d\u0435 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0435\u0433\u043e, \u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e!<\/em><\/p>\n<blockquote>\n<p>\u0410 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <a href=\"https:\/\/styled-components.com\/\">\u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0437\u0434\u0435\u0441\u044c<\/a><\/p>\n<\/blockquote>\n<h2>Linaria  <\/h2>\n<p>Linaria \u2014 <strong>\u044d\u0442\u043e zero-runtime CSS-in-JS \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430,<\/strong> \u043a\u043e\u0442\u043e\u0440\u0430\u044f <strong>\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0441\u0442\u0438\u043b\u0438, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 JS, \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 CSS \u0444\u0430\u0439\u043b\u044b<\/strong> \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0431\u043e\u0440\u043a\u0438. \u0412\u0441\u0435 \u044d\u0442\u043e \u0434\u043b\u044f \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0442\u0440\u0430\u0442 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u0435\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>Linaria <strong>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044b<\/strong> \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u0447\u0438\u0441\u0442\u044b\u0435 CSS \u0444\u0430\u0439\u043b\u044b. \u041e\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0444\u0438\u0447\u0438 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e CSS: \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043c\u0435\u0434\u0438\u0430-\u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0441\u0431\u043e\u0440\u043a\u0438, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a Webpack \u0438 Rollup.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Linaria, <strong>\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b:<\/strong><\/p>\n<pre><code class=\"bash\">npm install @linaria\/core @linaria\/react @linaria\/babel-preset<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c <a href=\"https:\/\/babeljs.io\/\">Babel<\/a>, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 <code>@linaria<\/code> \u0432 Babel \u043a\u043e\u043d\u0444\u0438\u0433:<\/p>\n<pre><code class=\"json\">{   \"presets\": [     \"@babel\/preset-env\",     \"@babel\/preset-react\",     \"@linaria\/babel-preset\"   ] }<\/code><\/pre>\n<p>Linaria <strong>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u0438<\/strong> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>css<\/code> \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>styled<\/code>:<\/p>\n<pre><code class=\"javascript\">import { css } from '@linaria\/core';  const titleStyle = css`   font-size: 24px;   color: #333;   text-align: center; `;  function Title() {   return &lt;h1 className={titleStyle}>Hello, Linaria!&lt;\/h1>; }  export default Title;<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 <code>titleStyle<\/code> \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 <code>Title<\/code>.<\/p>\n<p>Linaria \u0442\u0430\u043a\u0436\u0435 <strong>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432<\/strong> \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>styled<\/code>, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e Styled Components:<\/p>\n<pre><code class=\"javascript\">import { styled } from '@linaria\/react';  const Button = styled.button`   background-color: #007bff;   color: white;   border: none;   padding: 10px 20px;   border-radius: 4px;   cursor: pointer;    &amp;:hover {     background-color: #0056b3;   } `;  function App() {   return (     &lt;div>       &lt;h1>Welcome to Linaria!&lt;\/h1>       &lt;Button>Click me&lt;\/Button>     &lt;\/div>   ); }  export default App;<\/code><\/pre>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/strong> Linaria \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0435\u043c\u044b \u0432 React-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438:<\/p>\n<pre><code class=\"javascript\">\/\/ theme.js export const theme = {   colors: {     primary: '#007bff',     secondary: '#6c757d',   }, };  \/\/ Button.js import { styled } from '@linaria\/react'; import { theme } from '.\/theme';  const Button = styled.button`   background-color: ${theme.colors.primary};   color: white;   border: none;   padding: 10px 20px;   border-radius: 4px;   cursor: pointer;    &amp;:hover {     background-color: ${theme.colors.secondary};   } `;  export default Button;  \/\/ App.js import React from 'react'; import Button from '.\/Button';  function App() {   return (     &lt;div>       &lt;h1>Welcome to Themed Linaria!&lt;\/h1>       &lt;Button>Click me&lt;\/Button>     &lt;\/div>   ); }  export default App;<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0435\u043c\u0443 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0435 \u0432 \u0441\u0442\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 <code>Button<\/code>. \u0421\u0442\u0438\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0442\u0435\u043c\u044b.<\/p>\n<blockquote>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441 Linaria <a href=\"https:\/\/githu%D0%BC%D0%BE%D0%B6%D0%BD%D0%BE%20%D0%BE%D0%B7%D0%BD%D0%B0%D0%BA%D0%BE%D0%BC%D0%B8%D1%82%D1%8C%D1%81%D1%8F%20%D0%B7%D0%B4%D0%B5%D1%81%D1%8Cb.com\/callstack\/linaria\">\u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/blockquote>\n<h2>Emotion<\/h2>\n<p>Emotion \u2014 <strong>\u044d\u0442\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f CSS-in-JS,<\/strong> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0430\u044f \u043a\u0430\u043a \u0441\u0442\u0438\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u0442\u0430\u043a \u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 CSS \u0441\u0442\u0438\u043b\u0438. <\/p>\n<p>Emotion \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439: \u0447\u0435\u0440\u0435\u0437 styled-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 \u0447\u0435\u0440\u0435\u0437 css-\u0443\u0442\u0438\u043b\u0438\u0442\u0443.<\/p>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Emotion, <strong>\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b:<\/strong><\/p>\n<pre><code class=\"bash\">npm install @emotion\/react @emotion\/styled<\/code><\/pre>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u0435\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <\/strong><code>css<\/code>:<br \/><code>css<\/code> \u2014 \u044d\u0442\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0441\u0442\u0438\u043b\u0438 \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<pre><code class=\"javascript\">\/** @jsxImportSource @emotion\/react *\/ import { css } from '@emotion\/react';  const style = css`   color: hotpink; `;  function App() {   return &lt;div css={style}>Hello, Emotion!&lt;\/div>; }  export default App;<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u044e\u0437\u0430\u0435\u043c <code>css<\/code> \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u044f \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>css<\/code>.<\/p>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <\/strong><code>styled<\/code>:<br \/><code>styled<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c React-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0441 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u0438\u043b\u044f\u043c\u0438.<\/p>\n<pre><code class=\"javascript\">import styled from '@emotion\/styled';  const Button = styled.button`   background-color: #007bff;   color: white;   border: none;   padding: 10px 20px;   border-radius: 4px;   cursor: pointer;    &amp;:hover {     background-color: #0056b3;   } `;  function App() {   return (     &lt;div>       &lt;Button>Click me&lt;\/Button>     &lt;\/div>   ); }  export default App;<\/code><\/pre>\n<p><strong>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0442\u0438\u043b\u0438:<\/strong><br \/>Emotion \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0442\u0438\u043b\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u043f\u0441\u043e\u0432.<\/p>\n<pre><code class=\"javascript\">const Button = styled.button`   background-color: ${props => props.primary ? '#007bff' : 'white'};   color: ${props => props.primary ? 'white' : '#007bff'};   border: 2px solid #007bff;   padding: 10px 20px;   border-radius: 4px;   cursor: pointer;    &amp;:hover {     background-color: ${props => props.primary ? '#0056b3' : '#e0e0e0'};   } `;  function App() {   return (     &lt;div>       &lt;Button primary>Primary Button&lt;\/Button>       &lt;Button>Secondary Button&lt;\/Button>     &lt;\/div>   ); }  export default App; <\/code><\/pre>\n<p><strong>\u0422\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u044f:<\/strong><br \/>Emotion \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 <code>ThemeProvider<\/code>.<\/p>\n<pre><code class=\"javascript\">import { ThemeProvider } from '@emotion\/react';  const theme = {   colors: {     primary: '#007bff',     secondary: '#6c757d',   }, };  const Button = styled.button`   background-color: ${props => props.theme.colors.primary};   color: white;   border: none;   padding: 10px 20px;   border-radius: 4px;   cursor: pointer;    &amp;:hover {     background-color: ${props => props.theme.colors.secondary};   } `;  function App() {   return (     &lt;ThemeProvider theme={theme}>       &lt;div>         &lt;Button>Click me&lt;\/Button>       &lt;\/div>     &lt;\/ThemeProvider>   ); }  export default App;<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c<code>Button<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0442\u0435\u043c\u044b \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/strong> Emotion \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430:<\/p>\n<pre><code class=\"javascript\">import styled from '@emotion\/styled';  const Container = styled.div`   display: flex;   flex-direction: column;   align-items: center;   padding: 20px;    @media (min-width: 600px) {     flex-direction: row;   } `;  const Item = styled.div`   background-color: #f0f0f0;   margin: 10px;   padding: 20px;   border-radius: 4px; `;  function App() {   return (     &lt;Container>       &lt;Item>Item 1&lt;\/Item>       &lt;Item>Item 2&lt;\/Item>       &lt;Item>Item 3&lt;\/Item>     &lt;\/Container>   ); }  export default App;<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435<code>Container<\/code> \u043c\u0435\u043d\u044f\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u043b\u0435\u043a\u0441-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0448\u0438\u0440\u0438\u043d\u044b \u044d\u043a\u0440\u0430\u043d\u0430.<\/p>\n<blockquote>\n<p>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043a Emotion <a href=\"https:\/\/emotion.sh\/docs\/introduction\">\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c<\/a><\/p>\n<\/blockquote>\n<h2>Stitches  <\/h2>\n<p>Stitches \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 API, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0442\u0435\u043c \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0442\u0438\u043b\u0435\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c\u0438 \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0441\u0431\u043e\u0440\u043a\u0438<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 npm \u0438\u043b\u0438 yarn:<\/p>\n<pre><code class=\"bash\">npm install @stitches\/react # \u0438\u043b\u0438 yarn add @stitches\/react<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>createStitches<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 <strong>\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0441\u0442\u0438\u043b\u0435\u0439<\/strong> \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c styled-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b:<\/p>\n<pre><code class=\"javascript\">import { createStitches } from '@stitches\/react';  const { styled, css, globalCss, theme } = createStitches({   theme: {     colors: {       primary: '#007bff',       secondary: '#6c757d',     },     fontSizes: {       body: '16px',       heading: '24px',     },   }, });  const Button = styled('button', {   backgroundColor: '$primary',   color: 'white',   padding: '10px 20px',   borderRadius: '4px',   border: 'none',   cursor: 'pointer',    '&amp;:hover': {     backgroundColor: '$secondary',   }, });<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0443 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u043c \u0438 \u0441\u0442\u0438\u043b\u0435\u0439, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0445 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 <code>createStitches<\/code>.<\/p>\n<p>Stitches \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c <strong>\u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438<\/strong> \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>globalCss<\/code>:<\/p>\n<pre><code class=\"javascript\">const globalStyles = globalCss({   body: {     margin: 0,     fontFamily: 'Arial, sans-serif',   }, });  function App() {   globalStyles();    return (     &lt;div>       &lt;h1>Hello, Stitches!&lt;\/h1>       &lt;Button>Click me&lt;\/Button>     &lt;\/div>   ); }  export default App;<\/code><\/pre>\n<p>Stitches \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c <strong>\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0442\u0438\u043b\u0438<\/strong> \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u043f\u0441\u043e\u0432:<\/p>\n<pre><code class=\"javascript\">const Button = styled('button', {   variants: {     color: {       primary: {         backgroundColor: '$primary',         color: 'white',       },       secondary: {         backgroundColor: '$secondary',         color: 'white',       },     },   },   defaultVariants: {     color: 'primary',   }, });  function App() {   return (     &lt;div>       &lt;Button color=\"primary\">Primary Button&lt;\/Button>       &lt;Button color=\"secondary\">Secondary Button&lt;\/Button>     &lt;\/div>   ); }  export default App;<\/code><\/pre>\n<p>Stitches \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435<strong>\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u0435\u043c<\/strong>:<\/p>\n<pre><code class=\"javascript\">const lightTheme = theme({   colors: {     background: 'white',     text: 'black',   }, });  const darkTheme = theme({   colors: {     background: 'black',     text: 'white',   }, });  const Container = styled('div', {   backgroundColor: '$background',   color: '$text',   padding: '20px',   borderRadius: '8px', });  function App() {   const [isDark, setIsDark] = React.useState(false);    return (     &lt;div className={isDark ? darkTheme : lightTheme}>       &lt;Container>         &lt;h1>Hello, Stitches!&lt;\/h1>         &lt;Button onClick={() => setIsDark(!isDark)}>           Toggle Theme         &lt;\/Button>       &lt;\/Container>     &lt;\/div>   ); }  export default App;<\/code><\/pre>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430<\/strong> Stitches \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0441\u0442\u0438\u043b\u044f\u043c\u0438:<\/p>\n<pre><code class=\"javascript\">import { createStitches } from '@stitches\/react';  const { styled, globalCss } = createStitches({   theme: {     colors: {       primary: '#007bff',       secondary: '#6c757d',     },   }, });  const globalStyles = globalCss({   body: {     margin: 0,     fontFamily: 'Arial, sans-serif',   }, });  const Container = styled('div', {   display: 'flex',   flexDirection: 'column',   alignItems: 'center',   padding: '20px',    '@media(min-width: 600px)': {     flexDirection: 'row',   }, });  const Item = styled('div', {   backgroundColor: '#f0f0f0',   margin: '10px',   padding: '20px',   borderRadius: '4px', });  function App() {   globalStyles();    return (     &lt;Container>       &lt;Item>Item 1&lt;\/Item>       &lt;Item>Item 2&lt;\/Item>       &lt;Item>Item 3&lt;\/Item>     &lt;\/Container>   ); }  export default App;<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c <code>Container<\/code> \u0431\u0443\u0434\u0435\u0442 \u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u043b\u0435\u043a\u0441-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0448\u0438\u0440\u0438\u043d\u044b \u044d\u043a\u0440\u0430\u043d\u0430.<\/p>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u0437\u0434\u0435\u0441\u044c \u0443\u0436\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0432 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0443 Emotion. <\/p>\n<blockquote>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441\u043e Stiches<a href=\"https:\/\/stitches.dev\/\"> \u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0437\u0434\u0435\u0441\u044c<\/a><\/p>\n<\/blockquote>\n<h2>Vanilla-Extract<\/h2>\n<p>Vanilla-Extract \u2014 <strong>\u044d\u0442\u043e zero-runtime CSS-in-JS \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430,<\/strong> \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u0438 \u0432 TypeScript \u0438\u043b\u0438 JavaScript \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 CSS \u0444\u0430\u0439\u043b\u044b \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0431\u043e\u0440\u043a\u0438. <\/p>\n<p>Vanilla-Extract <strong>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439 \u0438 \u0442\u0435\u043c,<\/strong> \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 CSS \u0444\u0430\u0439\u043b\u044b.<\/p>\n<p><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c:<\/strong><\/p>\n<pre><code class=\"bash\">npm install @vanilla-extract\/css<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0441\u0431\u043e\u0440\u0449\u0438\u043a, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 Webpack, \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Vanilla-Extract. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043b\u0430\u0433\u0438\u043d \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e Webpack.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Webpack:<\/strong><\/p>\n<pre><code class=\"javascript\">\/\/ webpack.config.js const { VanillaExtractPlugin } = require('@vanilla-extract\/webpack-plugin');  module.exports = {   \/\/ ... \u0434\u0440\u0443\u0433\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438   plugins: [     new VanillaExtractPlugin(),   ],   module: {     rules: [       {         test: \/\\.css\\.ts$\/,         use: [           'vanilla-extract-loader',           'ts-loader',         ],       },     ],   }, };<\/code><\/pre>\n<p>Vanilla-Extract \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>style<\/code> \u0438 \u0442\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>createTheme<\/code>:<\/p>\n<pre><code class=\"typescript\">\/\/ styles.css.ts import { style } from '@vanilla-extract\/css';  export const button = style({   backgroundColor: 'blue',   color: 'white',   padding: '10px 20px',   borderRadius: '5px',   border: 'none',   cursor: 'pointer',   ':hover': {     backgroundColor: 'darkblue',   }, });<\/code><\/pre>\n<p><strong>\u0421\u0442\u0438\u043b\u0438<\/strong>, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Vanilla-Extract, <strong>\u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445 React<\/strong> \u0438\u043b\u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u0445:<\/p>\n<pre><code>\/\/ Button.tsx import React from 'react'; import { button } from '.\/styles.css.ts';  const Button: React.FC = () => {   return &lt;button className={button}>Click me&lt;\/button>; };  export default Button;<\/code><\/pre>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/strong> Vanilla-Extract \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0441\u0442\u0438\u043b\u044f\u043c\u0438 \u0438 \u0442\u0435\u043c\u0430\u043c\u0438:<\/p>\n<pre><code class=\"typescript\">\/\/ responsive.css.ts import { style } from '@vanilla-extract\/css';  export const container = style({   display: 'flex',   flexDirection: 'column',   alignItems: 'center',   padding: '20px',    '@media': {     '(min-width: 600px)': {       flexDirection: 'row',     },   }, });  export const item = style({   backgroundColor: '#f0f0f0',   margin: '10px',   padding: '20px',   borderRadius: '5px', });<\/code><\/pre>\n<pre><code>\/\/ App.tsx import React from 'react'; import { container, item } from '.\/responsive.css.ts';  const App: React.FC = () => {   return (     &lt;div className={container}>       &lt;div className={item}>Item 1&lt;\/div>       &lt;div className={item}>Item 2&lt;\/div>       &lt;div className={item}>Item 3&lt;\/div>     &lt;\/div>   ); };  export default App;<\/code><\/pre>\n<p><code>Container<\/code> \u043c\u0435\u043d\u044f\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u043b\u0435\u043a\u0441\u2011\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432\u00a0\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442\u00a0\u0448\u0438\u0440\u0438\u043d\u044b \u044d\u043a\u0440\u0430\u043d\u0430.<\/p>\n<blockquote>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435\u00a0\u2014 <a href=\"https:\/\/vanilla-extract.style\/\">\u0437\u0434\u0435\u0441\u044c<\/a><\/p>\n<\/blockquote>\n<h4>\u0424\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u043b\u043e\u0432\u0430<\/h4>\n<p>\u0412\u0441\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0445\u043e\u0440\u043e\u0448\u0438 \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0439\u0442\u0438 \u0441\u0432\u043e\u0439 \u043f\u043e \u0432\u043a\u0443\u0441\u0443. \u0425\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0443\u0441\u043b\u044b\u0448\u0430\u0442\u044c \u043e \u0432\u0430\u0448\u0435\u043c \u043e\u043f\u044b\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 CSS-in-JS, \u043a\u0430\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0438 \u043a\u0430\u043a\u0438\u0435 \u043d\u044e\u0430\u043d\u0441\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c?<\/p>\n<hr\/>\n<p><em>\u0412\u0441\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0432\u043e\u0438\u0442\u044c \u043d\u0430 \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0443\u0440\u0441\u0430\u0445 OTUS:<\/em><a href=\"https:\/\/otus.pw\/msGe\/\"><em> \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435<\/em><\/a><em> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c, \u0430 <\/em><a href=\"https:\/\/otus.pw\/wby1\/\"><em>\u0432 \u043a\u0430\u043b\u0435\u043d\u0434\u0430\u0440\u0435<\/em><\/a><em> \u2014 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u0443\u0440\u043e\u043a\u0438.<\/em><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/829322\/\"> https:\/\/habr.com\/ru\/articles\/829322\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><em>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/em><\/p>\n<p>\u0412\u00a0\u043e\u0434\u043d\u043e\u043c \u0438\u0437\u00a0\u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043c\u043d\u0435 \u043d\u0443\u0436\u043d\u043e\u00a0\u0431\u044b\u043b\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0430\u0434\u043c\u0438\u043d\u043a\u0443 \u0434\u043b\u044f\u00a0\u043a\u0440\u0443\u043f\u043d\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430. \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b \u0431\u043e\u043b\u044c\u0448\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0435\u0439, \u0430\u00a0\u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0442\u0435\u043c \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0442\u0438\u043b\u0435\u0439. \u0418\u043c\u0435\u043d\u043d\u043e \u0442\u043e\u0433\u0434\u0430 \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u043d\u0430\u00a0CSS\u2011in\u2011JS \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438 \u044d\u0442\u043e \u0434\u043b\u044f\u00a0\u043c\u0435\u043d\u044f \u0441\u0442\u0430\u043b\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435\u043c.<\/p>\n<p>\u0412\u0435\u0434\u044c \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432\u00a0\u2014 \u043e\u0441\u043d\u043e\u0432\u0430 \u0434\u043b\u044f\u00a0\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0445 \u0438 \u044d\u0441\u0442\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438\u044f\u0442\u043d\u044b\u0445 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u0432. \u0418 \u0438\u043d\u043e\u0433\u0434\u0430 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a\u00a0CSS\u2011\u0444\u0430\u0439\u043b\u044b \u0438\u043b\u0438\u00a0\u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b, \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0438 \u043c\u043e\u0433\u0443\u0442 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0441\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0447\u0435\u0433\u043e \u043c\u044b \u0442\u043e\u0447\u043d\u043e \u043d\u0435\u00a0\u0445\u043e\u0442\u0438\u043c.<\/p>\n<p>\u0417\u0434\u0435\u0441\u044c \u0432\u043e\u0442 \u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u043d\u0430\u00a0\u043f\u043e\u043c\u043e\u0449\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f CSS\u2011in\u2011JS, \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0449\u0438\u0435 \u0444\u0438\u0447\u0438 JS \u0438 CSS.<\/p>\n<p>CSS\u2011in\u2011JS\u00a0\u2014 \u044d\u0442\u043e \u043f\u043e\u0434\u0445\u043e\u0434 \u043a\u00a0\u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u0438 \u043f\u0440\u044f\u043c\u043e \u0432\u00a0JavaScript\u2011\u043a\u043e\u0434\u0435. \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0430:<\/p>\n<ol>\n<li>\n<p><strong>\u0418\u0437\u043e\u043b\u044f\u0446\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439<\/strong>: \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0442\u0438\u043b\u0438<\/strong>: \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0442\u0438\u043b\u0438 \u0432\u00a0\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442\u00a0\u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0438\u043b\u0438\u00a0\u043f\u0440\u043e\u043f\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0442\u0435\u043c<\/strong>: \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u0430\u043c\u0438 \u0438 \u0438\u0445 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0430\u00a0\u043b\u0435\u0442\u0443.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441\u00a0JavaScript<\/strong>.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u00a0\u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b\u00a0\u0431\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439 \u0422\u041e\u041f-5\u00a0\u043b\u0443\u0447\u0448\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 CSS\u2011in\u2011JS, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b.<\/p>\n<h2>Styled Components<\/h2>\n<p>Styled Components \u2014 \u044d\u0442\u043e <strong>\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u0438 React-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432<\/strong> \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c ES6 \u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432. \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c CSS \u0432 JavaScript, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0441\u0442\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u044e\u0442 \u0441\u0432\u043e\u0438 \u0441\u0442\u0438\u043b\u0438. \u0422\u0430\u043a \u0441\u0442\u0438\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0439 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0439.<\/p>\n<p>Styled Components<strong> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0442\u0435\u0433\u0438<\/strong> \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432 \u0434\u043b\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f CSS \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0430\u043c\u043e\u0433\u043e JS.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e npm \u0438\u043b\u0438 yarn:<\/p>\n<pre><code class=\"bash\">npm install styled-components # \u0438\u043b\u0438 yarn add styled-components<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/strong><\/p>\n<pre><code class=\"javascript\">import styled from 'styled-components';  const Button = styled.button`   background-color: #007bff;   color: white;   border: none;   padding: 10px 20px;   border-radius: 4px;   cursor: pointer;    &amp;:hover {     background-color: #0056b3;   } `;  function App() {   return (     &lt;div>       &lt;h1>Welcome to Styled-Components!&lt;\/h1>       &lt;Button>Click me&lt;\/Button>     &lt;\/div>   ); }  export default App;<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u043b\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>Button<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 React-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441 \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u0438\u043b\u044f\u043c\u0438. <strong>\u0421\u0442\u0438\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u043f\u0441\u043e\u0432<\/strong>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u043d\u0443\u0442\u0440\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0445 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u043e\u0432:<\/p>\n<pre><code class=\"javascript\">const Button = styled.button`   background-color: ${props => props.primary ? '#007bff' : 'white'};   color: ${props => props.primary ? 'white' : 'black'};   \/* ... \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0438\u043b\u0438 ... *\/ `;  function App() {   return (     &lt;div>       &lt;Button primary>Primary Button&lt;\/Button>       &lt;Button>Secondary Button&lt;\/Button>     &lt;\/div>   ); }<\/code><\/pre>\n<p>Styled Components <strong>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u044e<\/strong>. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>ThemeProvider<\/code>:<\/p>\n<pre><code class=\"javascript\">import { ThemeProvider } from 'styled-components';  const theme = {   primaryColor: '#007bff',   secondaryColor: '#6c757d', };  const Button = styled.button`   background-color: ${props => props.primary ? props.theme.primaryColor : props.theme.secondaryColor};   \/* ... \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0438\u043b\u0438 ... *\/ `;  function App() {   return (     &lt;ThemeProvider theme={theme}>       &lt;div>         &lt;Button primary>Primary Button&lt;\/Button>         &lt;Button>Secondary Button&lt;\/Button>       &lt;\/div>     &lt;\/ThemeProvider>   ); }  export default App;<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c<code>Button<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0442\u0435\u043c\u044b \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439.<\/p>\n<p>Styled Components \u0442\u0430\u043a\u0436\u0435 <strong>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438<\/strong> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>createGlobalStyle<\/code>:<\/p>\n<pre><code class=\"javascript\">import { createGlobalStyle } from 'styled-components';  const GlobalStyle = createGlobalStyle`   body {     font-family: 'Arial', sans-serif;     background-color: #f0f0f0;   } `;  function App() {   return (     &lt;>       &lt;GlobalStyle \/>       &lt;div>         &lt;h1>Hello, World!&lt;\/h1>       &lt;\/div>     &lt;\/>   ); }  export default App;<\/code><\/pre>\n<p><em>Styled Components \u2014 \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442. \u0415\u0441\u043b\u0438 \u0432\u044b \u0435\u0449\u0435 \u043d\u0435 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b\u0438 \u0435\u0433\u043e, \u043d\u0430\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e!<\/em><\/p>\n<blockquote>\n<p>\u0410 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 <a href=\"https:\/\/styled-components.com\/\">\u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0437\u0434\u0435\u0441\u044c<\/a><\/p>\n<\/blockquote>\n<h2>Linaria  <\/h2>\n<p>Linaria \u2014 <strong>\u044d\u0442\u043e zero-runtime CSS-in-JS \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430,<\/strong> \u043a\u043e\u0442\u043e\u0440\u0430\u044f <strong>\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0441\u0442\u0438\u043b\u0438, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 JS, \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 CSS \u0444\u0430\u0439\u043b\u044b<\/strong> \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0441\u0431\u043e\u0440\u043a\u0438. \u0412\u0441\u0435 \u044d\u0442\u043e \u0434\u043b\u044f \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u044f \u0437\u0430\u0442\u0440\u0430\u0442 \u043d\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u0435\u0439 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>Linaria <strong>\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u044b\u0435 \u043b\u0438\u0442\u0435\u0440\u0430\u043b\u044b<\/strong> \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0432 \u0447\u0438\u0441\u0442\u044b\u0435 CSS \u0444\u0430\u0439\u043b\u044b. \u041e\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0444\u0438\u0447\u0438 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e CSS: \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043c\u0435\u0434\u0438\u0430-\u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0441\u0431\u043e\u0440\u043a\u0438, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a Webpack \u0438 Rollup.<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Linaria, <strong>\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b:<\/strong><\/p>\n<pre><code class=\"bash\">npm install @linaria\/core @linaria\/react @linaria\/babel-preset<\/code><\/pre>\n<p>\u0417\u0430\u0442\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c <a href=\"https:\/\/babeljs.io\/\">Babel<\/a>, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 <code>@linaria<\/code> \u0432 Babel \u043a\u043e\u043d\u0444\u0438\u0433:<\/p>\n<pre><code class=\"json\">{   \"presets\": [     \"@babel\/preset-env\",     \"@babel\/preset-react\",     \"@linaria\/babel-preset\"   ] }<\/code><\/pre>\n<p>Linaria <strong>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u0438<\/strong> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>css<\/code> \u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>styled<\/code>:<\/p>\n<pre><code class=\"javascript\">import { css } from '@linaria\/core';  const titleStyle = css`   font-size: 24px;   color: #333;   text-align: center; `;  function Title() {   return &lt;h1 className={titleStyle}>Hello, Linaria!&lt;\/h1>; }  export default Title;<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 <code>titleStyle<\/code> \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u043a \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 <code>Title<\/code>.<\/p>\n<p>Linaria \u0442\u0430\u043a\u0436\u0435 <strong>\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432<\/strong> \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>styled<\/code>, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e Styled Components:<\/p>\n<pre><code class=\"javascript\">import { styled } from '@linaria\/react';  const Button = styled.button`   background-color: #007bff;   color: white;   border: none;   padding: 10px 20px;   border-radius: 4px;   cursor: pointer;    &amp;:hover {     background-color: #0056b3;   } `;  function App() {   return (     &lt;div>       &lt;h1>Welcome to Linaria!&lt;\/h1>       &lt;Button>Click me&lt;\/Button>     &lt;\/div>   ); }  export default App;<\/code><\/pre>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/strong> Linaria \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0435\u043c\u044b \u0432 React-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438:<\/p>\n<pre><code class=\"javascript\">\/\/ theme.js export const theme = {   colors: {     primary: '#007bff',     secondary: '#6c757d',   }, };  \/\/ Button.js import { styled } from '@linaria\/react'; import { theme } from '.\/theme';  const Button = styled.button`   background-color: ${theme.colors.primary};   color: white;   border: none;   padding: 10px 20px;   border-radius: 4px;   cursor: pointer;    &amp;:hover {     background-color: ${theme.colors.secondary};   } `;  export default Button;  \/\/ App.js import React from 'react'; import Button from '.\/Button';  function App() {   return (     &lt;div>       &lt;h1>Welcome to Themed Linaria!&lt;\/h1>       &lt;Button>Click me&lt;\/Button>     &lt;\/div>   ); }  export default App;<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0435\u043c\u0443 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0435 \u0432 \u0441\u0442\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 <code>Button<\/code>. \u0421\u0442\u0438\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0442\u0435\u043c\u044b.<\/p>\n<blockquote>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0441 Linaria <a href=\"https:\/\/githu%D0%BC%D0%BE%D0%B6%D0%BD%D0%BE%20%D0%BE%D0%B7%D0%BD%D0%B0%D0%BA%D0%BE%D0%BC%D0%B8%D1%82%D1%8C%D1%81%D1%8F%20%D0%B7%D0%B4%D0%B5%D1%81%D1%8Cb.com\/callstack\/linaria\">\u043c\u043e\u0436\u043d\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<\/blockquote>\n<h2>Emotion<\/h2>\n<p>Emotion \u2014 <strong>\u044d\u0442\u043e \u0432\u044b\u0441\u043e\u043a\u043e\u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f CSS-in-JS,<\/strong> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0449\u0430\u044f \u043a\u0430\u043a \u0441\u0442\u0438\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u0442\u0430\u043a \u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 CSS \u0441\u0442\u0438\u043b\u0438. <\/p>\n<p>Emotion \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439: \u0447\u0435\u0440\u0435\u0437 styled-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0438 \u0447\u0435\u0440\u0435\u0437 css-\u0443\u0442\u0438\u043b\u0438\u0442\u0443.<\/p>\n<p>\u0414\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Emotion, <strong>\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b:<\/strong><\/p>\n<pre><code class=\"bash\">npm install @emotion\/react @emotion\/styled<\/code><\/pre>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u0435\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <\/strong><code>css<\/code>:<br \/><code>css<\/code> \u2014 \u044d\u0442\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0441\u0442\u0438\u043b\u0438 \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0438\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0438.<\/p>\n<pre><code class=\"javascript\">\/** @jsxImportSource @emotion\/react *\/ import { css } from '@emotion\/react';  const style = css`   color: hotpink; `;  function App() {   return &lt;div css={style}>Hello, Emotion!&lt;\/div>; }  export default App;<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u044e\u0437\u0430\u0435\u043c <code>css<\/code> \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u044f \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0435\u0433\u043e \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0447\u0435\u0440\u0435\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <code>css<\/code>.<\/p>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <\/strong><code>styled<\/code>:<br \/><code>styled<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c React-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0441 \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0441\u0442\u0438\u043b\u044f\u043c\u0438.<\/p>\n<pre><code class=\"javascript\">import styled from '@emotion\/styled';  const Button = styled.button`   background-color: #007bff;   color: white;   border: none;   padding: 10px 20px;   border-radius: 4px;   cursor: pointer;    &amp;:hover {     background-color: #0056b3;   } `;  function App() {   return (     &lt;div>       &lt;Button>Click me&lt;\/Button>     &lt;\/div>   ); }  export default App;<\/code><\/pre>\n<p><strong>\u0414\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0442\u0438\u043b\u0438:<\/strong><br \/>Emotion \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0442\u0438\u043b\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043f\u0440\u043e\u043f\u0441\u043e\u0432.<\/p>\n<pre><code class=\"javascript\">const Button = styled.button`   background-color: ${props => props.primary ? '#007bff' : 'white'};   color: ${props => props.primary ? 'white' : '#007bff'};   border: 2px solid #007bff;   padding: 10px 20px;   border-radius: 4px;   cursor: pointer;    &amp;:hover {     background-color: ${props => props.primary ? '#0056b3' : '#e0e0e0'};   } `;  function App() {   return (     &lt;div>       &lt;Button primary>Primary Button&lt;\/Button>       &lt;Button>Secondary Button&lt;\/Button>     &lt;\/div>   ); }  export default App; <\/code><\/pre>\n<p><strong>\u0422\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u044f:<\/strong><br \/>Emotion \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 <code>ThemeProvider<\/code>.<\/p>\n<pre><code class=\"javascript\">import { ThemeProvider } from '@emotion\/react';  const theme = {   colors: {     primary: '#007bff',     secondary: '#6c757d',   }, };  const Button = styled.button`   background-color: ${props => props.theme.colors.primary};   color: white;   border: none;   padding: 10px 20px;   border-radius: 4px;   cursor: pointer;    &amp;:hover {     background-color: ${props => props.theme.colors.secondary};   } `;  function App() {   return (     &lt;ThemeProvider theme={theme}>       &lt;div>         &lt;Button>Click me&lt;\/Button>       &lt;\/div>     &lt;\/ThemeProvider>   ); }  export default App;<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c<code>Button<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0442\u0435\u043c\u044b \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0447\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0446\u0432\u0435\u0442\u043e\u0432\u043e\u0439 \u0441\u0445\u0435\u043c\u043e\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f<\/strong> Emotion \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430:<\/p>\n<pre><code class=\"javascript\">import styled from '@emotion\/styled';  const Container = styled.div`   display: flex;   flex-direction: column;   align-items: center;   padding: 20px;    @media (min-width: 600px) {     flex-direction: row;   } `;  const Item = styled.div`   background-color: #f0f0f0;   margin: 10px;   padding: 20px;   border-radius: 4px; `;  function App() {   return (     &lt;Container>       &lt;Item>Item 1&lt;\/Item>       &lt;Item>Item 2&lt;\/Item>       &lt;Item>Item 3&lt;\/Item>     &lt;\/Container>   ); }  export default App;<\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043a\u043e\u0434\u0435<code>Container<\/code> \u043c\u0435\u043d\u044f\u0435\u0442 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u043b\u0435\u043a\u0441-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0448\u0438\u0440\u0438\u043d\u044b \u044d\u043a\u0440\u0430\u043d\u0430.<\/p>\n<blockquote>\n<p>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043a Emotion <a href=\"https:\/\/emotion.sh\/docs\/introduction\">\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0434\u0435\u0441\u044c<\/a><\/p>\n<\/blockquote>\n<h2>Stitches  <\/h2>\n<p>Stitches \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0439 API, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0442\u0435\u043c \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u0442\u0438\u043b\u0435\u0439, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430\u043c\u0438 \u0438 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0441\u0431\u043e\u0440\u043a\u0438<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0447\u0435\u0440\u0435\u0437 npm \u0438\u043b\u0438 yarn:<\/p>\n<pre><code class=\"bash\">npm install @stitches\/react # \u0438\u043b\u0438 yarn add @stitches\/react<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>createStitches<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 <strong>\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0441\u0442\u0438\u043b\u0435\u0439<\/strong> \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-426880","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/426880","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=426880"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/426880\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=426880"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=426880"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=426880"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}