Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

styled componets npm

npm i styled-components
Comment

install styled components

npm install --save styled-components

yarn add styled-components
Comment

How to use Styled-Components

// INSTALL:
npm install --save styled-components

// IMPORT: i prefer to create a file for each component. Ex.: Button-Styled.js 
// (rather than a single file with all styled components, gets messy)
import styled from 'styled-components'

// USE: create a new file called componentName-Styled.js
// define a var with the name of the component = styled.htmltag`CSS styles`
const Button = styled.button`
  background: transparent;
  border-radius: 3px;
  border: 2px solid palevioletred;
  color: palevioletred;
  margin: 0 1em;
  padding: 0.25em 1em;
`
Comment

how to create styled components

import styled from 'styled-component';

// Create a Title component that'll render an <h1> tag with some styles
const Title = styled.h1`
  font-size: 1.5em;
  text-align: center;
  color: palevioletred;
`;

// Create a Wrapper component that'll render a <section> tag with some styles
const Wrapper = styled.section`
  padding: 4em;
  background: papayawhip;
`;

// Use Title and Wrapper like any other React component – except they're styled!
render(
  <Wrapper>
    <Title>
      Hello World!
    </Title>
  </Wrapper>
);
Comment

styled componennts

npm install --save styled-componentsnpm install --save styled-components
Comment

PREVIOUS NEXT
Code Example
Shell :: add spacer to dock macos 
Shell :: uncommit last commit 
Shell :: valet install command not found 
Shell :: change git url 
Shell :: git load all submodules 
Shell :: restart network service kali 
Shell :: code blocks download for debian 
Shell :: clean uninstall ubuntu-desktop from ubuntu server 
Shell :: set username git 
Shell :: how to unzip in gitbash 
Shell :: check application using port linux 
Shell :: delete .git folder 
Shell :: reload nginx 
Shell :: linux remove java 11 
Shell :: davinci resolve ubuntu intel gpu processing mode empty 
Shell :: git delete local branch no longer on remote 
Shell :: ubuntu stop process on port 
Shell :: how to check machine is 32bit or 64bit linux 
Shell :: change hostname ubuntu 20.04 
Shell :: install jenkins on ubuntu 
Shell :: pygame not installing in ubuntu 20.04 
Shell :: pandas pip install 
Shell :: ubuntu update firefox 
Shell :: hello world bash 
Shell :: bash if element in array 
Shell :: git revert one commit 
Shell :: bootstrap npm 
Shell :: crlf to lf in all files in vs code 
Shell :: dd show progress 
Shell :: get remote IP of wsl ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =