From ddea0f2afdbb8980ba99817085e916271f47e787 Mon Sep 17 00:00:00 2001 From: Emily Plummer Date: Thu, 15 Aug 2019 15:27:24 -0700 Subject: [PATCH 01/11] 5 things you need to know --- pages/components/docs/5-things | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 pages/components/docs/5-things diff --git a/pages/components/docs/5-things b/pages/components/docs/5-things new file mode 100644 index 00000000000..eb30d5f706e --- /dev/null +++ b/pages/components/docs/5-things @@ -0,0 +1,57 @@ +# 5 things you need to know about Primer Components + +1. The `as` prop +The `as` prop is a feature that all of our components get from [styled-components]. It allows you to pass a HTML tag or another component to a Primer Component to be rendered as the base tag of that component. + + +For example, say you are using a `Button` component, and you really need to apply `Flex` styles to it. You can compose `Flex` and `Button` like so: + +``` + + +``` From f97d05c5164f16085112bd261a42cefd63842dbd Mon Sep 17 00:00:00 2001 From: Emily Plummer Date: Mon, 19 Aug 2019 08:53:44 -0700 Subject: [PATCH 10/11] ignore cache --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ce81f9ae886..abac98732db 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ coverage/ dist/ node_modules +.cache From 05d637e9a1cb4c281dd43069ccd48a1ea012cce1 Mon Sep 17 00:00:00 2001 From: Emily Plummer Date: Mon, 19 Aug 2019 09:17:15 -0700 Subject: [PATCH 11/11] update docs --- pages/components/docs/core-concepts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pages/components/docs/core-concepts b/pages/components/docs/core-concepts index 20c0ee493ce..336117cbfe5 100644 --- a/pages/components/docs/core-concepts +++ b/pages/components/docs/core-concepts @@ -25,6 +25,8 @@ When push comes to shove and you just _really_ need to add a custom CSS rule, yo ``` +Please note that you will need to have the **[styled-components babel plugin](https://www.styled-components.com/docs/tooling#babel-plugin)** set up in your project in order to use the `css` prop. + ## Types of components We categorize our components into 3 general types. Building block components, pattern components, and helper components. Understanding how these types of components interact with each other can help you better understand how to get the most out of Primer Components.