{"componentChunkName":"component---src-templates-category-js","path":"/mixins/shape","result":{"pageContext":{"node":{"frontmatter":{"category":"mixins","description":"Mixins to style elements as shapes","slug":"shape","title":"Shape"},"body":"var _excluded = [\"components\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"Shape\",\n  \"slug\": \"shape\",\n  \"category\": \"mixins\",\n  \"description\": \"Mixins to style elements as shapes\"\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"div\", {\n    className: \"code-block__description\"\n  }, \"Shape mixins currently supports 4 configurable shape types, and are designed to have the bare minimum styles to display an element as a shape. If the element has any child elements or text inside you may have to add additional styles to adjust the presentation of the child elements or text to taste.\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"arrow\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"round\"), \" \"), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"square\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"rectangle\"))), mdx(\"h2\", null, \"Arrow Shape\"), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.arrow(@direction, @size, @color);\")), mdx(\"div\", {\n    className: \"code-block__description\"\n  }, \"Arrow shapes take in 3 parameters:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"@direction\"), \" \", mdx(\"em\", {\n    parentName: \"li\"\n  }, \"(required)\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"@size\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"strong\", {\n    parentName: \"li\"\n  }, \"@color\"))), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.arrow(right);\"), mdx(Shape, {\n    index: \"01\",\n    mdxType: \"Shape\"\n  })), mdx(\"div\", {\n    className: \"code-block__description\"\n  }, \"By default the size is set to 1rem and the colour is set to the @color[primary] setting. To change the size pass in a size value:\"), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.arrow(left, 40px);\"), mdx(Shape, {\n    index: \"02\",\n    mdxType: \"Shape\"\n  })), mdx(\"div\", {\n    className: \"code-block__description\"\n  }, \"To change the color (background-color), pass in a color as a 3rd parameter:\"), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.arrow(up, 2.5rem, @ocean-green);\"), mdx(Shape, {\n    index: \"03\",\n    mdxType: \"Shape\"\n  })), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.arrow(down, 50px, @ocean-green);\"), mdx(Shape, {\n    index: \"04\",\n    mdxType: \"Shape\"\n  })), mdx(\"hr\", null), mdx(\"h2\", null, \"Round Shape\"), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.round(@size, @color);\")), mdx(\"div\", {\n    className: \"code-block__description\"\n  }, \"For round shapes you can pass in padding, width and height (as the same value) and background-color.\"), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.round();\"), mdx(Shape, {\n    index: \"05\",\n    mdxType: \"Shape\"\n  })), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.round(1rem, @orange);\"), mdx(Shape, {\n    index: \"06\",\n    mdxType: \"Shape\"\n  })), mdx(\"hr\", null), mdx(\"h2\", null, \"Square Shape\"), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.square(@type, @size, @background);\")), mdx(\"div\", {\n    className: \"code-block__description\"\n  }, \"Square shapes take 3 parameters. By default, the size is set to 100px and the background color defaults to the @color[primary] setting.\"), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.square();\"), mdx(Shape, {\n    index: \"07\",\n    mdxType: \"Shape\"\n  })), mdx(\"div\", {\n    className: \"code-block__description\"\n  }, \"For rounded edgeds you can pass in the 'rounded' type as the first parameter. You can also add a custom size and background color.\"), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.square(rounded, 70px, @color[secondary]);\"), mdx(Shape, {\n    index: \"08\",\n    mdxType: \"Shape\"\n  })), mdx(\"div\", {\n    className: \"code-block__description\"\n  }, \"To adjust the border radius, pass in a custom value as the 4th parameter.\"), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.square(rounded, 70px, @color[secondary], 10px);\"), mdx(Shape, {\n    index: \"09\",\n    mdxType: \"Shape\"\n  })), mdx(\"hr\", null), mdx(\"h2\", null, \"Rectangle Shape\"), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.rectangle(@type, @size, @background);\")), mdx(\"div\", {\n    className: \"code-block__description\"\n  }, \"Similar to the square shape mixin, rectangle shapes take in the same parameters of type, size and background color. The difference between the 2 is that the size of the square shape is an equal width and height value, and the rectangle divides the given size (width) value by 3 to caluclate the height value.\"), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.rectangle();\"), mdx(Shape, {\n    index: \"10\",\n    mdxType: \"Shape\"\n  })), mdx(\"div\", {\n    className: \"code-block__description\"\n  }, \"By default, the rectangle shape will have a size value of 100px, therefore the width will be 100px and height will be 33.333333px, and the background color will default to the @color[primary] setting. You can change the size by specifying a size value and change the backgound color by passing it in as a parameter.\"), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.rectangle(200px, @crimson);\"), mdx(Shape, {\n    index: \"11\",\n    mdxType: \"Shape\"\n  })), mdx(\"div\", {\n    className: \"code-block__description\"\n  }, \"For rounded edges, pass in 'rounded' as the first parameter. The border radius value is set to the @settings[radius] value, which in this case is set to 4px.\"), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.rectangle(rounded, 150px, @violet);\"), mdx(Shape, {\n    index: \"12\",\n    mdxType: \"Shape\"\n  })), mdx(\"div\", {\n    className: \"code-block__description\"\n  }, \"To adjust the border radius, pass in a custom value as the 4th parameter.\"), mdx(\"div\", {\n    className: \"code-block\"\n  }, mdx(CodeBlock, {\n    mixinName: \"shape\",\n    mdxType: \"CodeBlock\"\n  }, \"#shape.rectangle(rounded, 150px, @violet, 20px);\"), mdx(Shape, {\n    index: \"13\",\n    mdxType: \"Shape\"\n  })));\n}\n;\nMDXContent.isMDXComponent = true;"},"documentationLinks":{"Installation":{"linkText":"Installation","linkRoute":"/documentation/installation"},"Settings":{"linkText":"Settings","linkRoute":"/documentation/settings"}},"mixinLinks":{"Border":{"linkText":"Border","linkRoute":"/mixins/border"},"Button":{"linkText":"Button","linkRoute":"/mixins/button"},"Font":{"linkText":"Font","linkRoute":"/mixins/font"},"Display":{"linkText":"Display","linkRoute":"/mixins/display"},"Form":{"linkText":"Form","linkRoute":"/mixins/form"},"Gradient":{"linkText":"Gradient","linkRoute":"/mixins/gradient"},"Grid":{"linkText":"Grid","linkRoute":"/mixins/grid"},"Hide":{"linkText":"Hide","linkRoute":"/mixins/hide"},"Position":{"linkText":"Position","linkRoute":"/mixins/position"},"Shape":{"linkText":"Shape","linkRoute":"/mixins/shape"}},"variablesLinks":{"Breakpoints":{"linkText":"Breakpoints","linkRoute":"/variables/breakpoints"},"Color Names":{"linkText":"Color Names","linkRoute":"/variables/color-names"}},"category":"mixins"}},"staticQueryHashes":[]}