{"id":352749,"date":"2024-05-20T22:14:34","date_gmt":"2024-05-20T22:14:34","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=352749"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-20T22:14:34","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=352749","title":{"rendered":"<span>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Tailwind CSS \u0434\u043b\u044f Rails 7.0.2<\/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>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0412\u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u044d\u0442\u043e\u0442 CSS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u0441\u0438\u0434\u0435\u043b \u043d\u0430 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0435 \u0438 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u041d\u043e \u0442\u0443\u0442 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0438 \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0432\u0438\u0442\u044c\u0435\u0432\u0430\u0442\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0441\u0442\u0438\u043b\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442. <\/p>\n<p>\u0412\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u043b\u0438 \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 rails \u043d\u0430 rails 7.0.2 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<p><code>rails new APPLICATION_NAME css:tailwind, js:esbuild,<\/code> <\/p>\n<p>\u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0441\u0442\u0438\u043b\u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442? \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432 \u043b\u043e\u0433\u0430\u0445 \u043a\u0443\u0447\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u0441 \u0430\u0441\u0441\u0435\u0442\u0430\u043c\u0438. <\/p>\n<p>\u0423\u0441\u043b\u043e\u0432\u0438\u044f:<\/p>\n<ol>\n<li>\n<p>\u044f \u0431\u0443\u0434\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u043c yarn. \u041e\u043d \u043a\u043b\u0435\u0432\u044b\u0439 \u0438 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0438 \u044f \u043a \u043d\u0435\u043c\u0443 \u043f\u0440\u0438\u0432\u044b\u043a, \u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043b\u044e\u0431\u044b\u043c \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u043c. <\/p>\n<\/li>\n<li>\n<p>\u0412 \u0447\u0430\u0441\u0442\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e slim, \u0434\u043b\u044f slim css tailwind \u0442\u043e\u0436\u0435 \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0442 \u0441\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0432\u044b \u0438\u0445 \u0441\u0430\u043c\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c. <\/p>\n<\/li>\n<li>\n<p>\u0432 \u0447\u0430\u0441\u0442\u0438 jsbuilder&#8217;a \u044f \u0432\u0437\u044f\u043b \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e esbuild<\/p>\n<\/li>\n<\/ol>\n<h3>\u0428\u0430\u0433 1. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 PostCss<\/h3>\n<p>\u042d\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u0448\u0442\u0443\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043e \u0441\u0442\u0438\u043b\u044f\u043c\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 js.  \u0411\u0435\u0437 \u043d\u0435\u0433\u043e Tailwind \u0438 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u043c\u043e\u0434\u043d\u044b\u0445 CSS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<\/p>\n<p><code>yarn add postcss postcss-flexbugs-fixes postcss-import postcss-nested<\/code><\/p>\n<h3>\u0428\u0430\u0433 2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Tailwind CSS<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0438 \u0432\u044b \u0441\u043b\u043e\u0432\u0438\u043b\u0438 \u0432\u0441\u044e \u043c\u0430\u0433\u0438\u044e, \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0433\u0435\u043c tailwind-rails. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 Tailwind \u0438\u0434\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u043e\u0442 \u0433\u0435\u043c, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e Rails \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 css \u0433\u0435\u043c\u043e\u043c gem &#171;cssbundling-rails&#187;. \u042f \u043f\u0440\u043e \u044d\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u043b \u0438 \u0434\u043e\u043b\u0433\u043e \u043f\u043e\u043c\u0443\u0447\u0430\u043b\u0441\u044f. <br \/> \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c gem &#171;tailwindcss-rails&#187; \u0432 \u0433\u0435\u043c\u0444\u0430\u0439\u043b \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443  <code>bundle install<\/code><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0441\u0430\u043c\u0443:<\/p>\n<p> <code>rails tailwindcss:install<\/code><\/p>\n<p>Tailwind \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u043e\u0432, \u043d\u043e \u043d\u0435 \u0432\u0441\u0435. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 slim, \u043a\u0430\u043a \u0443 \u043c\u0435\u043d\u044f \u0442\u043e \u043e\u043d \u0441\u043a\u0430\u0436\u0435\u0442, \u0442\u043e \u043d\u0435 \u043d\u0430\u0448\u0435\u043b <\/p>\n<p><code>rails tailwindcss:install<br \/> Default application.html.erb is missing!<br \/> Add &lt;%= stylesheet_link_tag \"tailwind\", \"inter-font\", \"data-turbo-track\": \"reload\" %> within the  tag in your custom layout.<\/code><\/p>\n<p>\u0412\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<h3>\u0428\u0430\u0433 3. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Stimlus<\/h3>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0433\u0435\u043c gem &#171;stimulus-rails&#187; \u0432 \u0433\u0435\u043c\u0444\u0430\u0439\u043b<br \/> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c<br \/> <code>rails stimulus:install<\/code><\/p>\n<p>\u041f\u043e\u0442\u043e\u043c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<br \/> <code>rails stimulus:manifest:update<\/code><\/p>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432  javascript\\application.js:<br \/> <code>\/\/ Entry point for the build script in your package.json<br \/> import <a class=\"mention\" href=\"\/users\/hotwired\">@hotwired<\/a>d\/turbo-rails\"<br \/> import \".\/controllers\"<\/code><\/p>\n<p>\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443<br \/> <code>yarn build<\/code><\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0447\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0447\u0435\u0440\u0435\u0437 foreman \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>bin\/dev<\/code><\/p>\n<h3>\u0428\u0430\u0433 4. \u0427\u0442\u043e\u0431\u044b CSS \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0440\u0443\u043a\u0430\u043c\u0438 \u0432 \u043a\u043e\u0440\u043d\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p> \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0440\u0443\u043a\u0430\u043c\u0438 \u0444\u0430\u0439\u043b\u044b \u0432 \u043a\u043e\u0440\u043d\u0435 \u0432\u0430\u0448\u0435\u0433\u043e Rails \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (\u0443 \u043c\u0435\u043d\u044f covenant):<\/p>\n<p>\u0424\u0410\u0419\u041b 1: covenant\\postcss.config.js:<br \/> <code>module.exports = {<br \/> plugins: {<br \/> tailwindcss: {},<br \/> autoprefixer: {},<br \/> },<br \/> };<\/code><\/p>\n<p>\u0424\u0410\u0419\u041b 2 covenant\\tailwind.config.js:<br \/> <code>module.exports = {<br \/> purge: [\"app\/assets\/stylesheets\/application.tailwind.css\"],<br \/> darkMode: false, \/\/ \u0438\u043b\u0438 'media' \u0438\u043b\u0438 'class'<br \/> theme: {<br \/> extend: {},<br \/> },<br \/> variants: {<br \/> extend: {},<br \/> },<br \/> plugins: [],<br \/> paths: {<br \/> styles: [\"app\/assets\/stylesheets\/application.tailwind.css\"],<br \/> output: \"app\/assets\/builds\",<br \/> },<br \/> };<\/code><\/p>\n<p>\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 <code>purge<\/code> \u043d\u0443\u0436\u043d\u0430 \u0447\u0442\u043e\u0431\u044b \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0433\u0434\u0435 \u043b\u0435\u0436\u0430\u0442 \u0430\u0441\u0441\u0435\u0442\u044b, \u0430 \u0442\u043e \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c 100500 warnings, \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0442\u0443\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u044b, \u0430 \u043e\u043d\u0438 \u043f\u0440\u0430\u0432\u0434\u0430 \u0435\u0441\u0442\u044c \u0438\u043b\u0438 \u043d\u0435\u0442<\/p>\n<p>\u0424\u0410\u0419\u041b 3 covenant\\esbuild.config.js<\/p>\n<p> <code>const path = require('path');<br \/> const tailwindcss = require('tailwindcss');<\/code><\/p>\n<p><code>module.exports = {<br \/> entryPoints: ['app\/javascript\/application.js'],<br \/> bundle: true,<br \/> outfile: 'app\/assets\/builds\/application.js',<br \/> plugins: [tailwindcss('app\/assets\/stylesheets\/application.tailwind.css')],<br \/> };<\/code><\/p>\n<h3>\u0428\u0410\u0413 5. \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0438\u043b\u0438<\/h3>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0444\u0430\u0439\u043b covenant\\app\\assets\\stylesheets\\application.tailwind.css:<br \/> <code><a class=\"mention\" href=\"\/users\/import\">@import<\/a> \"tailwindcss\/base\";<br \/> <a class=\"mention\" href=\"\/users\/import\">@import<\/a> \"tailwindcss\/components\";<br \/> <a class=\"mention\" href=\"\/users\/import\">@import<\/a> \"tailwindcss\/utilities\";<br \/> \/* app components *\/<\/code><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 2 \u0444\u0430\u0439\u043b\u0430 application.tailwind.css \u0438 application.js \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0430\u0441\u0441\u0435\u0442\u044b \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c foreman \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u0438 \u0432 layout<\/p>\n<h3>\u0428\u0410\u0413 7. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Foreman<\/h3>\n<p>Foreman \u043d\u0438 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u0430\u043a \u0433\u0435\u043c \u0432 bundle, \u0434\u043b\u044f \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u043d \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0444\u0430\u0439\u043b Procfile.dev, \u0432 \u043a\u043e\u0440\u043d\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. <\/p>\n<p>\u043f\u0438\u0448\u0435\u043c \u0442\u0443\u0434\u0430:<br \/> <code>web: unset PORT &amp;&amp; env RUBY_DEBUG_OPEN=true bin\/rails server<br \/> js: yarn build --watch<br \/> css: yarn build:css --watch<br \/> css: bin\/rails tailwindcss:watch<\/code><\/p>\n<p>\u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u044d\u0442\u043e. \u0418 \u0442\u043e\u0433\u0434\u0430 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0430\u0441\u0441\u0435\u0442\u044b \u043d\u0430\u043b\u0435\u0442\u0443, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0432\u044b \u043d\u0430\u0436\u043c\u0435\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 Save<\/p>\n<h3>\u0428\u0430\u0433 8. \u0417\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Layout&#8217;a<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0441\u0442\u0438\u043b\u0438 \u0438 JS \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435 \u043a \u0431\u0430\u0437\u043e\u0432\u043e\u043c\u0443 \u0441\u043b\u043e\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Layout.<\/p>\n<p>\u0418\u0434\u0435\u043c \u0432 covenant\\app\\views\\layouts\\application.html.slim:<br \/> \u0438 \u043f\u0438\u0448\u0435\u043c \u0432\u043e\u0442 \u044d\u0442\u0438 2 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b head<\/p>\n<pre><code>= stylesheet_link_tag \"tailwind\", \"inter-font\", \"data-turbo-track\": \"reload\" = javascript_include_tag \"application\", \"data-turbo-track\": \"reload\", defer: true <\/code><\/pre>\n<p>\u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Tailwind. \u0418 \u0432\u0443\u0430\u043b\u044f \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p> \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <code>bin\/dev<\/code> \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430\u0448\u0438 \u0441\u0442\u0438\u043b\u0438.<\/p>\n<p>\u042d\u0442\u043e \u044f\u0432\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u0432 Bootstrap css, \u043d\u043e Tailwind \u0431\u043e\u043b\u0435\u0435 \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u044b\u0439, \u043a\u043b\u0430\u0441\u0441\u043d\u044b\u0439 \u0438 \u0442\u0430\u043c \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u044f\u043a\u0438\u0445 \u0433\u0438\u0431\u043a\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0433\u043e UX, \u0430 \u0447\u0435\u0440\u0435\u0437 Stimulus \u0443\u0436\u0435 \u0434\u043e\u043f\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u044f\u043a\u0438\u0435 \u0432\u0435\u0449\u0438.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f5e\/db2\/357\/f5edb2357a4b96acda453afb8104935b.png\" width=\"1266\" height=\"596\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f5e\/db2\/357\/f5edb2357a4b96acda453afb8104935b.png\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/14b\/f7d\/96f\/14bf7d96f355d5e3695dd064d79aa86c.png\" width=\"1895\" height=\"984\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/14b\/f7d\/96f\/14bf7d96f355d5e3695dd064d79aa86c.png\"\/><\/figure>\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\/755914\/\"> https:\/\/habr.com\/ru\/articles\/755914\/<\/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>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442! \u0412\u043f\u0435\u0440\u0432\u044b\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u044d\u0442\u043e\u0442 CSS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u0441\u0438\u0434\u0435\u043b \u043d\u0430 \u0431\u0443\u0442\u0441\u0442\u0440\u0430\u043f\u0435 \u0438 \u043d\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u043b\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u041d\u043e \u0442\u0443\u0442 \u0440\u0435\u0448\u0438\u043b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0438 \u043d\u0430\u0442\u043a\u043d\u0443\u043b\u0441\u044f \u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0432\u0438\u0442\u044c\u0435\u0432\u0430\u0442\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u0441\u0442\u0438\u043b\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043e\u043f\u044b\u0442\u043e\u043c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0443-\u0442\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442. <\/p>\n<p>\u0412\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u043b\u0438 \u043d\u043e\u0432\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 rails \u043d\u0430 rails 7.0.2 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<p><code>rails new APPLICATION_NAME css:tailwind, js:esbuild,<\/code> <\/p>\n<p>\u043d\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0441\u0442\u0438\u043b\u0438 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442? \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0432 \u043b\u043e\u0433\u0430\u0445 \u043a\u0443\u0447\u0430 \u043e\u0448\u0438\u0431\u043e\u043a \u0441 \u0430\u0441\u0441\u0435\u0442\u0430\u043c\u0438. <\/p>\n<p>\u0423\u0441\u043b\u043e\u0432\u0438\u044f:<\/p>\n<ol>\n<li>\n<p>\u044f \u0431\u0443\u0434\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u043c yarn. \u041e\u043d \u043a\u043b\u0435\u0432\u044b\u0439 \u0438 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0438 \u044f \u043a \u043d\u0435\u043c\u0443 \u043f\u0440\u0438\u0432\u044b\u043a, \u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043b\u044e\u0431\u044b\u043c \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u043e\u043c. <\/p>\n<\/li>\n<li>\n<p>\u0412 \u0447\u0430\u0441\u0442\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0442\u043e\u0440\u0430 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e slim, \u0434\u043b\u044f slim css tailwind \u0442\u043e\u0436\u0435 \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0442 \u0441\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438, \u0432\u044b \u0438\u0445 \u0441\u0430\u043c\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c. <\/p>\n<\/li>\n<li>\n<p>\u0432 \u0447\u0430\u0441\u0442\u0438 jsbuilder&#8217;a \u044f \u0432\u0437\u044f\u043b \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e esbuild<\/p>\n<\/li>\n<\/ol>\n<h3>\u0428\u0430\u0433 1. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 PostCss<\/h3>\n<p>\u042d\u0442\u043e \u0442\u0430\u043a\u0430\u044f \u0448\u0442\u0443\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043e \u0441\u0442\u0438\u043b\u044f\u043c\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 js.  \u0411\u0435\u0437 \u043d\u0435\u0433\u043e Tailwind \u0438 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u043c\u043e\u0434\u043d\u044b\u0445 CSS \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<\/p>\n<p><code>yarn add postcss postcss-flexbugs-fixes postcss-import postcss-nested<\/code><\/p>\n<h3>\u0428\u0430\u0433 2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Tailwind CSS<\/h3>\n<p>\u0427\u0442\u043e\u0431\u044b \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u043b \u0438 \u0432\u044b \u0441\u043b\u043e\u0432\u0438\u043b\u0438 \u0432\u0441\u044e \u043c\u0430\u0433\u0438\u044e, \u0432\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0433\u0435\u043c tailwind-rails. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 Tailwind \u0438\u0434\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u043e\u0442 \u0433\u0435\u043c, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e Rails \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u0442 css \u0433\u0435\u043c\u043e\u043c gem &#171;cssbundling-rails&#187;. \u042f \u043f\u0440\u043e \u044d\u0442\u043e \u043d\u0435 \u0437\u043d\u0430\u043b \u0438 \u0434\u043e\u043b\u0433\u043e \u043f\u043e\u043c\u0443\u0447\u0430\u043b\u0441\u044f. <br \/> \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c gem &#171;tailwindcss-rails&#187; \u0432 \u0433\u0435\u043c\u0444\u0430\u0439\u043b \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443  <code>bundle install<\/code><\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0441\u0430\u043c\u0443:<\/p>\n<p> <code>rails tailwindcss:install<\/code><\/p>\n<p>Tailwind \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u043e\u0432, \u043d\u043e \u043d\u0435 \u0432\u0441\u0435. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430 slim, \u043a\u0430\u043a \u0443 \u043c\u0435\u043d\u044f \u0442\u043e \u043e\u043d \u0441\u043a\u0430\u0436\u0435\u0442, \u0442\u043e \u043d\u0435 \u043d\u0430\u0448\u0435\u043b <\/p>\n<p><code>rails tailwindcss:install<br \/> Default application.html.erb is missing!<br \/> Add &lt;%= stylesheet_link_tag \"tailwind\", \"inter-font\", \"data-turbo-track\": \"reload\" %> within the  tag in your custom layout.<\/code><\/p>\n<p>\u0412\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<h3>\u0428\u0430\u0433 3. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Stimlus<\/h3>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0433\u0435\u043c gem &#171;stimulus-rails&#187; \u0432 \u0433\u0435\u043c\u0444\u0430\u0439\u043b<br \/> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c<br \/> <code>rails stimulus:install<\/code><\/p>\n<p>\u041f\u043e\u0442\u043e\u043c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<br \/> <code>rails stimulus:manifest:update<\/code><\/p>\n<p>\u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0432  javascript\\application.js:<br \/> <code>\/\/ Entry point for the build script in your package.json<br \/> import <a class=\"mention\" href=\"\/users\/hotwired\">@hotwired<\/a>d\/turbo-rails\"<br \/> import \".\/controllers\"<\/code><\/p>\n<p>\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0431\u043e\u0440\u043a\u0443<br \/> <code>yarn build<\/code><\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0447\u0442\u043e \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0447\u0435\u0440\u0435\u0437 foreman \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>bin\/dev<\/code><\/p>\n<h3>\u0428\u0430\u0433 4. \u0427\u0442\u043e\u0431\u044b CSS \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0438 \u0440\u0443\u043a\u0430\u043c\u0438 \u0432 \u043a\u043e\u0440\u043d\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p> \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0440\u0443\u043a\u0430\u043c\u0438 \u0444\u0430\u0439\u043b\u044b \u0432 \u043a\u043e\u0440\u043d\u0435 \u0432\u0430\u0448\u0435\u0433\u043e Rails \u043f\u0440\u043e\u0435\u043a\u0442\u0430 (\u0443 \u043c\u0435\u043d\u044f covenant):<\/p>\n<p>\u0424\u0410\u0419\u041b 1: covenant\\postcss.config.js:<br \/> <code>module.exports = {<br \/> plugins: {<br \/> tailwindcss: {},<br \/> autoprefixer: {},<br \/> },<br \/> };<\/code><\/p>\n<p>\u0424\u0410\u0419\u041b 2 covenant\\tailwind.config.js:<br \/> <code>module.exports = {<br \/> purge: [\"app\/assets\/stylesheets\/application.tailwind.css\"],<br \/> darkMode: false, \/\/ \u0438\u043b\u0438 'media' \u0438\u043b\u0438 'class'<br \/> theme: {<br \/> extend: {},<br \/> },<br \/> variants: {<br \/> extend: {},<br \/> },<br \/> plugins: [],<br \/> paths: {<br \/> styles: [\"app\/assets\/stylesheets\/application.tailwind.css\"],<br \/> output: \"app\/assets\/builds\",<br \/> },<br \/> };<\/code><\/p>\n<p>\u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 <code>purge<\/code> \u043d\u0443\u0436\u043d\u0430 \u0447\u0442\u043e\u0431\u044b \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0433\u0434\u0435 \u043b\u0435\u0436\u0430\u0442 \u0430\u0441\u0441\u0435\u0442\u044b, \u0430 \u0442\u043e \u0431\u0443\u0434\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c 100500 warnings, \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0442\u0443\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u044b, \u0430 \u043e\u043d\u0438 \u043f\u0440\u0430\u0432\u0434\u0430 \u0435\u0441\u0442\u044c \u0438\u043b\u0438 \u043d\u0435\u0442<\/p>\n<p>\u0424\u0410\u0419\u041b 3 covenant\\esbuild.config.js<\/p>\n<p> <code>const path = require('path');<br \/> const tailwindcss = require('tailwindcss');<\/code><\/p>\n<p><code>module.exports = {<br \/> entryPoints: ['app\/javascript\/application.js'],<br \/> bundle: true,<br \/> outfile: 'app\/assets\/builds\/application.js',<br \/> plugins: [tailwindcss('app\/assets\/stylesheets\/application.tailwind.css')],<br \/> };<\/code><\/p>\n<h3>\u0428\u0410\u0413 5. \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0442\u0438\u043b\u0438<\/h3>\n<p>\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0444\u0430\u0439\u043b covenant\\app\\assets\\stylesheets\\application.tailwind.css:<br \/> <code><a class=\"mention\" href=\"\/users\/import\">@import<\/a> \"tailwindcss\/base\";<br \/> <a class=\"mention\" href=\"\/users\/import\">@import<\/a> \"tailwindcss\/components\";<br \/> <a class=\"mention\" href=\"\/users\/import\">@import<\/a> \"tailwindcss\/utilities\";<br \/> \/* app components *\/<\/code><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 2 \u0444\u0430\u0439\u043b\u0430 application.tailwind.css \u0438 application.js \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u0430\u0441\u0441\u0435\u0442\u044b \u043f\u043e\u0433\u0440\u0443\u0436\u0430\u0442\u044c\u0441\u044f \u0432 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c foreman \u0438 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0438\u043b\u0438 \u0432 layout<\/p>\n<h3>\u0428\u0410\u0413 7. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Foreman<\/h3>\n<p>Foreman \u043d\u0438 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u0430\u043a \u0433\u0435\u043c \u0432 bundle, \u0434\u043b\u044f \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u043d \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0444\u0430\u0439\u043b Procfile.dev, \u0432 \u043a\u043e\u0440\u043d\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. <\/p>\n<p>\u043f\u0438\u0448\u0435\u043c \u0442\u0443\u0434\u0430:<br \/> <code>web: unset PORT &amp;&amp; env RUBY_DEBUG_OPEN=true bin\/rails server<br \/> js: yarn build --watch<br \/> css: yarn build:css --watch<br \/> css: bin\/rails tailwindcss:watch<\/code><\/p>\n<p>\u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u044d\u0442\u043e. \u0418 \u0442\u043e\u0433\u0434\u0430 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0430\u0441\u0441\u0435\u0442\u044b \u043d\u0430\u043b\u0435\u0442\u0443, \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0432\u044b \u043d\u0430\u0436\u043c\u0435\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 Save<\/p>\n<h3>\u0428\u0430\u0433 8. \u0417\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439. \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 Layout&#8217;a<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0434\u043e \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u043d\u0430\u0448\u0438 \u0441\u0442\u0438\u043b\u0438 \u0438 JS \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435 \u043a \u0431\u0430\u0437\u043e\u0432\u043e\u043c\u0443 \u0441\u043b\u043e\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Layout.<\/p>\n<p>\u0418\u0434\u0435\u043c \u0432 covenant\\app\\views\\layouts\\application.html.slim:<br \/> \u0438 \u043f\u0438\u0448\u0435\u043c \u0432\u043e\u0442 \u044d\u0442\u0438 2 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u0432 \u0440\u0430\u0437\u0434\u0435\u043b head<\/p>\n<pre><code>= stylesheet_link_tag \"tailwind\", \"inter-font\", \"data-turbo-track\": \"reload\" = javascript_include_tag \"application\", \"data-turbo-track\": \"reload\", defer: true <\/code><\/pre>\n<p>\u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Tailwind. \u0418 \u0432\u0443\u0430\u043b\u044f \u0443 \u043d\u0430\u0441 \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<p> \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <code>bin\/dev<\/code> \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0430\u0448\u0438 \u0441\u0442\u0438\u043b\u0438.<\/p>\n<p>\u042d\u0442\u043e \u044f\u0432\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0447\u0435\u043c \u0432 Bootstrap css, \u043d\u043e Tailwind \u0431\u043e\u043b\u0435\u0435 \u0430\u0434\u0430\u043f\u0442\u0438\u0432\u043d\u044b\u0439, \u043a\u043b\u0430\u0441\u0441\u043d\u044b\u0439 \u0438 \u0442\u0430\u043c \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u044f\u043a\u0438\u0445 \u0433\u0438\u0431\u043a\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0433\u043e UX, \u0430 \u0447\u0435\u0440\u0435\u0437 Stimulus \u0443\u0436\u0435 \u0434\u043e\u043f\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u044f\u043a\u0438\u0435 \u0432\u0435\u0449\u0438.<\/p>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\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\/755914\/\"> https:\/\/habr.com\/ru\/articles\/755914\/<\/a><br \/><\/br><\/br><\/p>\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-352749","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/352749","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=352749"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/352749\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=352749"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=352749"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=352749"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}