- 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-height
property. - 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
:root
means - Define
font-size
inhtml
element, why 62.5% and the advantage of it, and what does the unitrem
mean. - File structure(code split) with
_base.scss
,_layout.scss
and_components.scss
.
- ❓There is an unsolved problem, or not fully understand problem, which is when header has a margin-top, the
body
element will be overflowed. Thebody
element not includeheader
element'smargin-top
area, which is confusing. - ❓The meaning of each value of
box-shadow
. - The elements of layout in
index.html
is nested, but the style sheet is separated.It may for the readablity.Nested elements with same prifix can be easily written withsass
syntax, while elements without them have no need to be nested. - Setting the
max-width
propery, 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
flex
measns:grow shrink basis
, and default toflex:0 1 auto
.
- Using
svg-sprites.svg
as 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:href
attribute 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
bem
block, element, modifier css layout naming methodology. - How to format a
svg
? Settingheight
andwidth
attributes for size, andfill:color
for 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
svg
element is no different, it is because of the wrapper element which in this case is thebutton
element. Some reasons I found: 1.button
element has its own user agent stylesheet, it doesn't get style inheritance; 2.line-heigth
andfont-size
has influence to the height ofbutton
element; 3.align-items
defaultstretch
will 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
:focus
and:active
. - Minus margin and padding for icon place wihin
<input />
:margin-right: -num
,padding-right:num
; input
andbutton
can't get inheritfont-size
,color
,font-family
and other attributes, need to be manually set;- Pseudo event
:focus
has aoutline
, which needs to be set tonone
; justify-content: space-between
and 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-size
in_layout.scss
for inner components to inherit.
- For layout symmetric we need to modify some early settings:
logo margin-left
. align-self:stretch
to 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-raidus
a 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-raidus
let 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::before
means 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-index
only works when the element is assigned a specific position.- The
:active
pseudo 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.
currentColor
is 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 ablock
orinline-block
if the wide space is not needed. margin:auto
withflexbox
layout can occupy white space and avoid the size of element grow!- For
svg
elements, they act like pure-text, there is space below them. change thedisplay
of their parent element, or change parent elementfont-size:0
. - Remember to group selector together with different names.
letter-spacing:size
is for letter space as the name descripted.- Setting
align-self:self
of a flex item to make element cross axis space occupies whole row. - Setting
marin-bottom:-2px
to move its below element a bit close to it. - To make
inline-button
component 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
:focus
triggered. - Did
box-shadow
has anone
value?
- 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-type
and:last-child
?- How to use
flex-wrap:wrap
to align? with the help offlex
to flex item to asign the size in their main axis. - use
<svg>
in css is like other image withbackground-image
andbackground-size
. - use new feature of
mask-image
to 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:auto
to two flex item in a flex row, which will get the effect ofjustify-content:space-between
. - In this project, only set
border width
value causes the img size shrink, setbox-sizing:content-box
to fix it. - What is the diff between
:last-child
and: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-index
always shows with aposition
.- A html entity cheatsheet website: https://css-tricks.com/snippets/html/glyphs/
- The
font-family:sans-serif
shows different in different OS. - Setting
line-height:1
to 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
padding
setting inButton
component, 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-fisrt
project, when always usemax-width
for media query. And put the small size below the large size. - Media query can't use css custom properties as variable? why?
- Use
media query
in each selector and pseudo event / element that will imporve the code readablity. - The keyword of
@supports
and 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
only
andand
inmedia-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.3
with nodeversion >=16
,installnpm i -D node-sass
with 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__item
with 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.