{"id":644,"date":"2019-11-18T11:23:59","date_gmt":"2019-11-18T17:23:59","guid":{"rendered":"https:\/\/marcblase.com\/blog\/?p=644"},"modified":"2019-11-18T11:23:59","modified_gmt":"2019-11-18T17:23:59","slug":"negative-value-for-margin-using-calc-in-scss","status":"publish","type":"post","link":"https:\/\/ma.rcbla.se\/blog\/2019\/11\/negative-value-for-margin-using-calc-in-scss\/","title":{"rendered":"Negative value for margin using calc() in SCSS"},"content":{"rendered":"<p>Using SCSS and need to set a negative margin with calc on an interpolated variable. Here&#8217;s the solution:<\/p>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\r\n.container {\r\n  margin-top: calc((#{$VAR_NAME} + 0px)\/-1); \/\/ divide by -1 to get a negative result\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Using SCSS and need to set a negative margin with calc on an interpolated variable. Here&#8217;s the solution: .container { margin-top: calc((#{$VAR_NAME} + 0px)\/-1); \/\/ divide by -1 to get a negative result }<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,12,3],"tags":[],"class_list":["post-644","post","type-post","status-publish","format-standard","hentry","category-coding","category-css-coding","category-discoveries"],"_links":{"self":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/comments?post=644"}],"version-history":[{"count":1,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/644\/revisions"}],"predecessor-version":[{"id":645,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/644\/revisions\/645"}],"wp:attachment":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/media?parent=644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/categories?post=644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/tags?post=644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}