Spaced Repetition
What are we doing now?
You’re going to use this prep time to answer some questions and schedule in times to review your understanding. In your planner or calendar, schedule a short (10 minute) review of your answers:
💡 Space at increasing intervals
- One week from today
- One month from today
- Three months from today
- Six months from today
- One year from today
Do this now. Then move forward to working through as many of these questions as you can. (You may not complete them all, and that is ok.)
Write down your answers first and then update them after looking at the sample answers, if it’s useful to do so. Use all available tools to help you answer, and remember:
the point is not to complete the exercises
the point is for you to secure your own understanding
Examples of tools you might use
What Is CSS
Learning Objectives
10 Things About CSS
What is CSS?
Cascading Style Sheets are a language of style - a way to change how we visualise the DOM - using selectors, properties, and values in rulesets. They provide a way to change how a browser displays HTML.
A ruleset is made up of a selector and a list of declarations. A declaration is made up of one property and value pair. This is the syntax of CSS.
What is a selector, property, and value?
selector {
property: value;
}
Rulesets look like this: p { background: red; }
. The selector is the p
in this case. This p
selects all elements of the DOM tree called p
and sets rules about how to show them. Selectors always come first in a ruleset.
A property is a quality, a characteristic. A value is the amount.
For a person, you might say their ‘age’ property has the value of 40. For an element, you might set the width
property to the value of 100%
.
Within a ruleset, multiple declarations may set values for properties, and each declaration ends with a semi-colon (;
), e.g. p { background: red; color: blue; }
.
How do you know what properties and values there are?
You learn them by using them. You look it up here: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference. Another thing you can do is look at the autocomplete in Devtools.
Why is CSS a 'cascading' style sheet? What does cascade mean?
A cascade is a stream or sequence of a things where each thing affects the next. You might imagine pouring champagne into a tower of glasses. The champagne flows into the top container; it then cascades into the next container; etc. In CSS we’re actually pouring from many bottles into one tower.
So in CSS ’the cascade’ means the order or sequence of the rules as they flow into the DOM tree according to CSS precedence.
Several rules may apply to one element, and they are applied in a particular order, with later, more specific, or more important rules adding to or overriding ones that have already been applied.
What does precedence mean?
It means the order rules are applied.
One way rules are applied in CSS is inheritance: children inherit from parents. If a parent node has red text, all its children will inherit that red text color. But when another rule with higher precendence comes and overrules, it replaces the rule which had lower precedence. An explicit rule targeting an element directly overrules a rule it inherited from its parent.
Inheritance forms a hierarchy. The elements being styled are hierarchical - with children inheriting from (but perhaps overriding) parents.
Everything in CSS is determined by order. Order is so important in CSS because CSS is a declarative programming language that programs the layout of boxes.
CSS renders the nodes in our DOM tree as nested boxes, and we program their appearance using fonts, colours, and spacing.
What does declarative mean?
It means that we describe a set of rules, and all of the rules are processed and then applied, in a well-known order, in one go. The browser works out how to apply the rules. You don’t write for loops or if/else statements; there are no functions as such; you just declare the outcome with some rules, and those rules get applied.
In CSS you do the ‘what’, and the browser does the ‘how’.
What is specificity?
Specificity is a weighting system for CSS rules. The more specific your selector, the more power it has. For example: IDs can only ever mean one node. IDs are unique, so they are more specific than classes, which could mean many nodes.
Classes added to html element are more specific than just a plain element selector, as a class of p
(e.g. p.instruction
) is more specific than just all p
. If you get two rules with the same specificity then the one that comes last in the order wins.
The browser sorts all your rulesets, or declarations, into a defined order according to the power, or weight, of the declaration and applies the result, like a game of cards where higher value cards beat lower value cards.
Stronger rules override weaker rules. Everything is sorted and sorted until eventually a final value wins out and the view is rendered.
This only applies where there is a conflict. If both p { color: red; background-color: blue; }
and p.instruction { color: orange; }
apply to the same element, the color
will end up orange
because it was specified in a more specific rule, but the background-color
will still be blue
because nothing overrode that property.
The browser sorts like this:
- Match the media
- Sort by origin
- Sort by specificity
- Sort by document order
Specificity forms a hierarchy. CSS rules are hierarchical - with more specific rules being applied after (and perhaps overriding) less specific rules.
What do we mean by order?
Order means ‘what comes first?’.
Another way to think of ‘earlier and later’ is ‘farther and nearer’. The closer the declaration is to the node in the DOM, the ‘later’ it is in the CSS. So an inline style overrides a style set in a style block, which overrides a stylesheet linked in the head, which overrides any stylesheet linked higher up in the head, which all ultimately overrides the user agent style that comes in the browser.
What does specify mean?
Identify clearly. Name explicitly.
What does render mean in context of a browser?
Render means to hand over, or to give back. In the browser, it means to show the result of all these computations we have talked about. It turns the code into pixels and paints them on your screen. So it’s the end result - how the page finally looks on your screen.
Youtube: CSS skills practice 🔗
Prep for active listening
🤙🏽 FeedbackLearning Objectives
Introduction
What is active listening?
🎯 Goal: Learn about active listening (20 minutes)
- Watch this short video on what Active Listening is.
- Read this piece on Active Reading to get a more in-depth understanding of why listening is such an important skill and how you can improve it.
Write down open-ended questions.
🎯 Goal: Prepare for the Saturday’s lesson. (40 minutes)
Considering what you have learned regarding Active Listening, write down some open-ended questions related to building relationship, building empathy and resolving conflicts which you will use in the lesson.Backlog
Learning Objectives
In software development, we break down complex projects into smaller, manageable parts, which we work on for a week or two. These periods are called “sprints.”
A sprint backlog is like a to-do list. It lists what the team has decided to work on this sprint. It’s chosen from a larger list, usually called the “product backlog,” which holds the entire project to-do list.
In this course, the backlog is a set of work designed to build understanding beyond the concepts introduced in the course prep. For your course, we have prepared a backlog of mandatory work for each sprint. You will copy these tasks into your own backlog. You can also add any other tickets you want to work on to your backlog, and schedule all of the tasks according to your own goals and capacity. Use your planning board to do this.
You will find the backlog in the Backlog view on every sprint.
Copy the tickets you are working on to your own backlog. Organise your tickets on your board and move them to the right column as you work through them. Here’s a flowchart showing the stages a ticket goes through:
Backlog (30 minutes)
- Find the sprint backlog
- Copy your tickets to your own backlog
- Organise your tickets on your board