https://aiman99aleryany.github.io/pancakeswap/
-
Mobile First Design
-
Atomic Design
-
Sections:
-
header
position: relative
display: flex
background: background-color
-
footer
position: relative
display: flex
background: background-color
-
sectionN
position: relative
display: flex
-
-
Wrappers:
flex-items
- Block ->
card
- Element ->
card__specs
- Modifier ->
card--light
orcard--dark
/* Block */
.card {
// here are basic rule soft the card
display: flex;
/* Element */
&__specs {
// here are the rules of an element of a card
}
/* Modifier */
&--light {
// here is the color of the card
background-color: white;
}
}
- coming soon...
icons/
Folder contains all the ICO images.images/
Folder contains all the JPG/PNG/SVG images.- Names of images should follow SCSS classes, e.g.
section1-card.png
.
- Names of images should follow SCSS classes, e.g.
logos/
Folder contains the website logo/brand and all the other logos.scripts/
Folder contains all the JS files.styles/
Folder contains all the SCSS files.styles/sectionN/
Folder named after a corresponding SCSS section.styles/sectionN/section.scss
File contains the section class.styles/sectionN/section-wrapper.scss
File contains the wrapper inside that section.styles/sectionN/section-wrapper-media.scss
File contains the desktop design.
atomic/
Folder contains the dynamic Modules that can be used across the website..gitignore
File contains all the ignored files.index.html
File contains all the HTML code for the landing page.other.html
File contains 1 more single page besides the landing page, will be built after finishing the landing page.
-
- If the code is not clear, write comments.
- Functions Are your Friends :)
- Use them all the time.
- Create functions for small processes, each function should do only 1 thing.
- Use class name and then Camel-Case naming convention with vars. something like this:
$section-wrapperPadding
.- check the
root.scss
file, you can see many examples.
- check the
- Atomic design vars have only Camel-Case naming convention.
- Colors has the snake naming convention.
- Use VisBug extension on the browser to see the actual paddings, widths, heights etc. from the original website.
<!-- Behaves like a section -->
<header>
<!-- Behaves like a section-wrapper -->
<nav>
<!-- code here -->
</nav>
</header>
<main>
<section class="section1">
<div class="section1-wrapper">
<!-- code here -->
</div>
</section>
<section class="...section7">
<div class="...section7-wrapper">
<!-- code here -->
</div>
</section>
</main>
<!-- Behaves as a section -->
<footer>
<section class="footer-wrapper">
<!-- code here -->
</section>
</footer>
-
Write the code for the parent section class inside
section.scss
. -
header.scss
&footer.scss
are consideredsection.scss
. -
Inside
header/nav
Folder thenav.scss
is consideredsection-wrapper.scss
. -
Write your code inside the
section-wrapper.scss
files. -
Nesting:
-
Maximum 2 deep layers:
.card { &__specs { // don't go deeper than this } } // if you want to go deeper write another class: .card__specs { card__specs-button { } }
-
Clean, simple code.
-
-
Put all mixins in:
./styles/atomic/root/root_mixins.scss
. -
Put all functions in:
./styles/atomic/root/root_functions.scss
. -
Put all variables in
./styles/atomic/root/root.scss
.- If you add vars, make sure to state that in the description of your Pull Request.
-
Put all resets in:
./styles/base/resets.scss
. -
Put all type selectors in:
./styles/base.scss
. -
Maintain the same folder structure. Don't add any new files excluding ICO/JPG/PNG/SVG.
- If you add a new file other than images, make sure to state that in the group chat in discord, and don't forget to import it in
./styles/main/main.scss
.
- If you add a new file other than images, make sure to state that in the group chat in discord, and don't forget to import it in
-
Writing imports:
- Write imports like this:
@use "./folder/file" as f;
. - Not like this:
@use "./folder/file" as *;
. - Call Vars like this:
file.var;
.
- Write imports like this:
-
Use
rem
overpx
, if you want to usepx
convert it using the functions inside./styles/atomic/root_functions.scss
. -
Use the provided atomic designs when it comes to buttons, links, or animation.
-
Never use the keyword
!important
. -
Never use inline CSS.
-
All wrappers has only MaxWidth of 1152px, name of the variable with the root:
root.$wrappersMaxWidth
- You can test your code by compiling only the
./styles/main/main.scss
file. - You can test your code by compiling a specific file using the terminal by writing the command:
sass --watch ./styles/<section>/<file>.scss <file>.css
.
- e.g.
Added navbar languages menu
- e.g.
Fixed navbar horizontal scrollbar bug
- Always check Trello and update your cards.
- Read commits log and see what's new.
-
Install these extensions and learn how to use them, (you can search by publisher filter):
- Banner comments. -- publisher:"HEYIMFUZZ"
- Better Comments. -- publisher:"Aaron Bond"
- Code spell checker. -- publisher:"Street Side Software"
- GitLens. -- publisher:"GitKraken"
- SCSS IntelliSense. -- publisher:"mrmlnc"
- Todo Tree -- publisher:"Gruntfuggly"
-
Activate the MiniMap to see the Banner comments.