https://project-stripe.netlify.app/
Project description goes here.
And here
// NavBar.jsx
import './NavBar.scss';
function NavBar() {
return (
<nav className="navbar">
<div className="navbar__spec">
some Content
<button className="navbar__spec-button">Click me!</button>
</div>
<div className="navbar__spec2"> some Content </div>
<div className="navbar-spec3"> some Content </div>
<div className="navbar-spec4"> some Content </div>
</nav>
)
}
// NavBar.scss
// This is the wrapper
// all wrappers will have a unified max-width
.navbar {
max-width: `the unifed max width`;
// inner elements and designs.
&__spec {
display: flex;
justfiy-content: center;
align-items: center;
&-button {
padding: 1rem;
}
}
}
BEM
card
card__specs
card--big
or card--small
e.g.
/* Block */
.card {
// here are basic styles for the card
display: flex;
/* Element */
&__specs {
// here are the rules of an element of a card, lets say card__specs class is for a <p> tag
color: red;
border: 2px solid black;
}
&--big {
width: 100px;
}
&--small {
width: 200px;
}
}
Try not to go deeper than 3 levels
.card {
&__specs {
&-button {
padding: 1rem;
}
}
}
!important
Never mix the logic with the representation, meaning:
e.g.1 Don’t put jsx in variables
e.g.2 Don’t return jsx from functions that are not components.
//example 1
function Component() {
const hello = <h1> Hello World </h1>;
return (
<div>
{
hello
}
</div>
)
}
//example 2
function Component() {
const render() {
return <h1> Hello World</h1>
}
return (
<div>
{
render()
}
</div>
)
}
e.g. “Add: Added navbar langauges menu | Fix: Fixed navbar horizontal scrollbar bug | Update: Changed navbar width” |
Install these extensions to make your life easier
Activate the minimap to see the Banner comments.