- Project Settings & Custom Properties
- Overall Layout
- Header
- Navigation
- Overview
- Description Section
- User Review Section
- CTA Section (stands for call for action)
- Media query
- Deployment.
- How the
@import[1] keyword works in sass. Partial is connected to\_\w+.s[ac]ss - How to correctly use
min-heightproperty. - How to set all element to
box-sizing:border-box. - How to define & use some pure CSS supported custom variables. And what the pseudo element
:rootmeans - Define
font-sizeinhtmlelement, why 62.5% and the advantage of it, and what does the unitremmean. - File structure(code split) with
_base.scss,_layout.scssand_components.scss.
- ❓There is an unsolved problem, or not fully understand problem, which is when header has a margin-top, the
bodyelement will be overflowed. Thebodyelement not includeheaderelement'smargin-toparea, which is confusing. - ❓The meaning of each value of
box-shadow. - The elements of layout in
index.htmlis nested, but the style sheet is separated.It may for the readablity.Nested elements with same prifix can be easily written withsasssyntax, while elements without them have no need to be nested. - Setting the
max-widthpropery, which let the element grow not too large, which allows the min length. In the same way, themin-{height,width}is to avoid too small and go through with the large number. - The value of property
flexmeasns:grow shrink basis, and default toflex:0 1 auto.
- Using
svg-sprites.svgas a collection of svg icons. How to generate and how to use it. Use the hash tag to position certain icon in ther sprites file. - The
xlink:hrefattribute in<use />within<svg>only works in a server environment like<template />element in HTML.The effect is the same as if the nodes were deeply cloned into a non-exposed DOM, then pasted where the use element is, much like cloned template elements2 in HTML5.
- SVG resource website: https://icomoon.io/.
- The
bemblock, element, modifier css layout naming methodology. - How to format a
svg? Settingheightandwidthattributes for size, andfill:colorfor color; - A VSCode extension called Comment Box generates box comments in
_components.scss.
- ❓A diff I find is the size of search icon is not the same as with mentor's, and it is weird. The
svgelement is no different, it is because of the wrapper element which in this case is thebuttonelement. Some reasons I found: 1.buttonelement has its own user agent stylesheet, it doesn't get style inheritance; 2.line-heigthandfont-sizehas influence to the height ofbuttonelement; 3.align-itemsdefaultstretchwill strech the button; And there must be other reason... - The usage of adjacent selector
+, when SOMEELEMENT's sibling elements has something pseudo event, SOMEELEMENT wants a certain corresponding style. - Pseudo event of button
:focusand:active. - Minus margin and padding for icon place wihin
<input />:margin-right: -num,padding-right:num; inputandbuttoncan't get inheritfont-size,color,font-familyand other attributes, need to be manually set;- Pseudo event
:focushas aoutline, which needs to be set tonone; justify-content: space-betweenand set middle elementflex:0 0 40%means it no grow no shrink and it has 40% of all width, the width can be used in its children elements as 100% of width.- Set
font-sizein_layout.scssfor inner components to inherit.
- For layout symmetric we need to modify some early settings:
logo margin-left. align-self:stretchto let the certain element occupy the whole row size of flex cross axis, which is very helpful for the pseudo event like:hover,...- Direct children element selector
>. - Why setting
border-raidusa very high value? differ from50%. - Why only set the height of the
<img />element, is it because of the origin size is square or the stardard force the height and width to be equal, or is for theborder-raiduslet it be a square-like.
- The cubic bezier function website https://cubic-bezier.com
- The navigation item often used with the
<ul>and<li>item within<nav />, and the link it's a<a />. - The order of pseudo element and pseudo event.
.class:hover::beforemeans diff with.class::before:hover. - Multipule transition effects separate with
,, and the Their sequence is the same with the start sequence. - Use
transform:scaleY()/scaleX()not width, why? It's easy to set the animation origin. - There is a deley for different transition effect.
- The common case for
<a />style,:link,:visited,and attribute istext-decoration. - The common case for
<ul />style:list-style. z-indexonly works when the element is assigned a specific position.- The
:activepseudo event. When does it triggered and can it put on any element? Often triggered when mouse left click.To style links appropriately, put the :active rule after all other link-related rules, as defined by the LVHA-order: :link — :visited — :hover — :active.
currentColoris useful. gives the element color of its own or of its parent.
- Why add a
<figure>over<img>, for a figure caption then what is a figure caption? - In responsible web design, always remember to assign a percentage size(
width,height) value of img, so that the image layout stays fluid. - The
<img>element need to be ablockorinline-blockif the wide space is not needed. margin:autowithflexboxlayout can occupy white space and avoid the size of element grow!- For
svgelements, they act like pure-text, there is space below them. change thedisplayof their parent element, or change parent elementfont-size:0. - Remember to group selector together with different names.
letter-spacing:sizeis for letter space as the name descripted.- Setting
align-self:selfof a flex item to make element cross axis space occupies whole row. - Setting
marin-bottom:-2pxto move its below element a bit close to it. - To make
inline-buttoncomponent more modular, set itsfont-size:inherit,background-color:transparent. - To make other colors follow event and avoid too many code in pseudo event, setting other color value to
currentColor. - Setting button
display:inline-block. - When does the pseudo event
:focustriggered. - Did
box-shadowhas anonevalue?
- Keep parent box padding the same as between children's margin.
- pure css variable can be used by another variable.
- Use
<p>,<ul>,<li>semantic elements. :last-of-typeand:last-child?- How to use
flex-wrap:wrapto align? with the help offlexto flex item to asign the size in their main axis. - use
<svg>in css is like other image withbackground-imageandbackground-size. - use new feature of
mask-imageto use svg. The anatomy of it is to set a mask and a background color, then we see bg color through the mask. - we also need to set
mask-size. - Set the
margin-right:autoto two flex item in a flex row, which will get the effect ofjustify-content:space-between. - In this project, only set
border widthvalue causes the img size shrink, setbox-sizing:content-boxto fix it. - What is the diff between
:last-childand:last-of-type? - What does
border-radius:<percentage>mean?
<figure />element is not only for pic/img but also for text/description for images.- There is a
<blockquote>,<figcaption>using inside of<figure>block. z-indexalways shows with aposition.- A html entity cheatsheet website: https://css-tricks.com/snippets/html/glyphs/
- The
font-family:sans-serifshows different in different OS. - Setting
line-height:1to erase extra height. - How to create big question mark as background-color?
- CTA is short for 'call for action'.
- The best way to hide an invisible element using
over-flow:hidden; - The difference with 2 different
paddingsetting inButtoncomponent, which meant to handle two string with two different string. - The pseudo event sequence: LVHA-order.
- How to set the breakpoints? To where the design start to break
- As a
browser-fisrtproject, when always usemax-widthfor media query. And put the small size below the large size. - Media query can't use css custom properties as variable? why?
- Use
media queryin each selector and pseudo event / element that will imporve the code readablity. - The keyword of
@supportsand the usage of it. - In
@supports, we should solve the repeat style outside of it. - Stay focus on the whole page layout instead of just some certain elements, sometimes you can fix these certain elements in other way rather than set specific break-points. In the project, like the
.recommend__photo. - The meanings of
onlyandandinmedia-query.
- Header-nav-content layout
- Input search
- Notification with number
- Side navigation layout
- Side navigation item with animation
- Button inline with infinite animation
- Avatars overlap layout
- A main Button with 2 text on hover
[1]. https://sass-lang.com/documentation/at-rules/import
[2]. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template
node-sass version 4.5.3with nodeversion >=16,installnpm i -D node-sasswith command-line syntaxnode-sass [options] <input> [output].
- Update all developement dependencies.
- Add a deps watcher.
- Abstract the deps
- Display some kind of user menu when hovering the username in
.user-nav - Display a message when hovering over the chat icon in
.user-nav(maybe like facebook) - Create a caption for the
.gallery__itemwith a nice hover effect. - Display a box with search suggestions as soon as the user starts typing in the search field;
- Make the page 100% responsive even for viewport sizes below 500px, maybe even responsive images.