Skip to content

Commit 63ce040

Browse files
committed
css selector precedence
1 parent cd7a6eb commit 63ce040

4 files changed

Lines changed: 58 additions & 0 deletions

File tree

css-selector-precedence/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# CSS Selector Precedence
2+
3+
> [https://youtu.be/eofMNcafgMU](https://youtu.be/eofMNcafgMU)
4+
5+
Install [io.js](https://iojs.org/en/index.html) or [node.js](https://nodejs.org/).
6+
7+
Within this folder run the terminal command `npm install` to install the
8+
`dependencies` and `devDependencies`.
9+
10+
Then run `npm start` to run the app and `http://localhost:9966` to view.

css-selector-precedence/index.html

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<title></title>
6+
<style>
7+
body {
8+
font-size: 3em;
9+
font-family: Helvetica;
10+
}
11+
</style>
12+
</head>
13+
<body>
14+
15+
16+
17+
<style>
18+
/* 1,0,1 */
19+
.animals strong { color: blue; }
20+
/* 0,2,1 */
21+
strong.bear.bears { color: green; }
22+
/* 0,2,1 */
23+
strong.bear.red { color: red; }
24+
</style>
25+
<div class="animals">
26+
<strong class="red bear bears" style="color: magenta;">Grizzly</strong>
27+
</div>
28+
29+
30+
31+
<script src="bundle.js" charset="utf-8"></script>
32+
</body>
33+
</html>

css-selector-precedence/index.js

Whitespace-only changes.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "css-selector-precedence",
3+
"version": "0.1.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"start": "budo index.js:bundle.js --live",
8+
"test": "node test.js"
9+
},
10+
"author": "Kyle Robinson Young <kyle@dontkry.com> (http://dontkry.com)",
11+
"license": "MIT",
12+
"devDependencies": {
13+
"budo": "^4.2.1"
14+
}
15+
}

0 commit comments

Comments
 (0)