{"id":5074,"date":"2021-08-09T10:17:13","date_gmt":"2021-08-09T10:17:13","guid":{"rendered":"https:\/\/www.bearloga.space\/?page_id=5074"},"modified":"2021-08-09T10:17:14","modified_gmt":"2021-08-09T10:17:14","slug":"sass-direktivy-funkczij","status":"publish","type":"page","link":"https:\/\/www.bearloga.space\/uk\/sass-direktivy-funkczij\/","title":{"rendered":"Sass \u2014 \u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u0412 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0437\u0443\u0447\u0430\u0442\u044c&nbsp;<strong>\u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/strong>&nbsp;.&nbsp;\u0412 SASS \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043b\u044e\u0431\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c.&nbsp;\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u043c\u0435\u043d\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0441 \u043b\u044e\u0431\u044b\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u043f\u0440\u0438\u043c\u0435\u0440<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 SCSS \u2014<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">function_directive.htm<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;html&gt;\n   &lt;head&gt;\n      &lt;title&gt;Nested Rules&lt;\/title&gt;\n      &lt;link rel = \"stylesheet\" type = \"text\/css\" href = \"style.css\" \/&gt;\n      &lt;link rel = \"stylesheet\" href = \"https:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/3.3.5\/css\/bootstrap.min.css\"&gt;\n      &lt;script src = \"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/2.1.3\/jquery.min.js\"&gt;&lt;\/script&gt;\n      &lt;script src = \"https:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/3.3.5\/js\/bootstrap.min.js\"&gt;&lt;\/script&gt;\n   &lt;\/head&gt;\n\n   &lt;body&gt;\n      &lt;div class = \"container\" id = \"set_width\"&gt;\n         &lt;h2&gt;Example for Function directives&lt;\/h2&gt;\n         &lt;p&gt;SASS stands for Syntactically Awesome Stylesheet. &lt;\/p&gt;\n      &lt;\/div&gt;\n   &lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b&nbsp;<em>style.scss<\/em>&nbsp;.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">style.scss<\/h3>\n\n\n\n<pre id=\"style33_scss\" class=\"wp-block-preformatted\">$first-width: 5px;\n$second-width: 5px;\n\n@function adjust_width($n) {\n   @return $n * $first-width + ($n - 1) * $second-width;\n}\n\n#set_width { padding-left: adjust_width(10); }\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c SASS \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0444\u0430\u0439\u043b \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c CSS \u043f\u0440\u0438 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0444\u0430\u0439\u043b\u0430 SASS, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sass --watch C:\\ruby\\lib\\sass\\style.scss:style.css\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0417\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0443\u044e \u0432\u044b\u0448\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443;&nbsp;\u043e\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0444\u0430\u0439\u043b&nbsp;<em>style.css<\/em>&nbsp;\u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043a\u043e\u0434\u043e\u043c \u2014<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">style.css<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">#set_width {\n   padding-left: 95px; \n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u0412\u044b\u0445\u043e\u0434<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0448\u0430\u0433\u0438, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u043a\u043e\u0434 \u2014<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 HTML-\u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b\u0435&nbsp;<strong>function_directive.html<\/strong>&nbsp;.<\/li><li>\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u044d\u0442\u043e\u0442 HTML-\u0444\u0430\u0439\u043b \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u0432\u044b\u0432\u043e\u0434 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u0442\u0430\u043a, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 HTML-\u043a\u043e\u0434 \u0432 \u0444\u0430\u0439\u043b\u0435&nbsp;<strong>function_directive.html<\/strong>&nbsp;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u044d\u0442\u043e\u0442 HTML-\u0444\u0430\u0439\u043b \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u0432\u044b\u0432\u043e\u0434 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u0442\u0430\u043a, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/coderlessons.com\/wp-content\/uploads\/2019\/07\/sass_function_directives_image1.jpg\" alt=\"\u0414\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b Sass Function\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 \u0432\u044b\u0432\u043e\u0434\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043b\u0435\u0432\u044b\u0439 \u043e\u0442\u0441\u0442\u0443\u043f.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 mixin, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.&nbsp;\u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f&nbsp;<strong>@return<\/strong>&nbsp;.&nbsp;\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0437\u0432\u0430\u0442\u044c SASS-\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u044b\u0437\u043e\u0432\u0438\u0442\u0435 \u0432\u044b\u0448\u0435\u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0438\u0436\u0435.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#set_width { padding-left: adjust_width($n: 10); }\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u0421\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043e\u0431 \u0438\u043c\u0435\u043d\u0430\u0445<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0427\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 \u0438\u043c\u0435\u043d, \u0438\u043c\u0435\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043c\u043e\u0433\u0443\u0442 \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441, \u0447\u0442\u043e\u0431\u044b \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u043a\u043e \u0434\u0438\u0444\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c.&nbsp;\u041a\u0430\u043a \u0438 \u043c\u0438\u043a\u0441\u0438\u043d\u044b, \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438.&nbsp;\u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u044b SASS \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u043d\u0438\u044f (_) \u0438 \u0434\u0435\u0444\u0438\u0441\u044b (-) \u0432\u0437\u0430\u0438\u043c\u043e\u0437\u0430\u043c\u0435\u043d\u044f\u0435\u043c\u043e.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u043a\u0430\u043a&nbsp;<strong>Adjust_width<\/strong>&nbsp;, \u043e\u043d\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0430 \u043a\u0430\u043a&nbsp;<strong>Adjust<\/strong>&nbsp;<strong>-width<\/strong>&nbsp;, \u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u044d\u0442\u043e\u0439 \u0433\u043b\u0430\u0432\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0437\u0443\u0447\u0430\u0442\u044c&nbsp;\u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0439&nbsp;.&nbsp;\u0412 SASS \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[157],"tags":[],"class_list":["post-5074","page","type-page","status-publish","hentry","category-sass"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/5074","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/comments?post=5074"}],"version-history":[{"count":1,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/5074\/revisions"}],"predecessor-version":[{"id":5075,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/pages\/5074\/revisions\/5075"}],"wp:attachment":[{"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/media?parent=5074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/categories?post=5074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bearloga.space\/uk\/wp-json\/wp\/v2\/tags?post=5074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}