Skip to content

Commit

Permalink
margin, borders, padding, positioning and floats examples for guides.
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelandrew committed Nov 22, 2018
1 parent 85ca8d2 commit 5c294a3
Show file tree
Hide file tree
Showing 6 changed files with 606 additions and 0 deletions.
105 changes: 105 additions & 0 deletions logical/border-longhands.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>Border Properties</title>
<link rel="stylesheet" href="../css-cookbook/styles.css">
<style>

.container {
display: flex;
}
.box {
border-radius: 5px;
background-color: rgba(96, 139, 168, .2);
margin: 10px;
width: 220px;
height:220px;
}

</style>

<style class="editable">
.box {
writing-mode: horizontal-tb;
direction: ltr;
}

.physical {
border-top: 2px solid hotpink;
border-right-style: dotted;
border-right-color: goldenrod;
border-right-width: 5px;
border-bottom: 4px double black;
border-left: none;
}

.logical {
border-block-start: 2px solid hotpink;
border-inline-end-style: dotted;
border-inline-end-color: goldenrod;
border-inline-end-width: 5px;
border-block-end: 4px double black;
border-inline-start: none;
}
</style>
</head>

<body>
<section class="preview">
<div class="container">
<div class="physical box">
Borders use physical properties.
</div>

<div class="logical box">
Borders use logical properties.
</div>
</div>
</section>

<textarea class="playable playable-css" style="height: 30px;">
.box {
writing-mode: horizontal-tb;
direction: ltr;
}

.physical {
border-top: 2px solid hotpink;
border-right-style: dotted;
border-right-color: goldenrod;
border-right-width: 5px;
border-bottom: 4px double black;
border-left: none;
}

.logical {
border-block-start: 2px solid hotpink;
border-inline-end-style: dotted;
border-inline-end-color: goldenrod;
border-inline-end-width: 5px;
border-block-end: 4px double black;
border-inline-start: none;
}</textarea>

<textarea class="playable playable-html" style="height: 180px;">
<div class="container">
<div class="physical box">
Borders use physical properties.
</div>

<div class="logical box">
Borders use logical properties.
</div>
</div>
</textarea>


<div class="playable-buttons">
<input id="reset" type="button" value="Reset">
</div>
</body>
<script src="../css-cookbook/playable.js"></script>

</html>
91 changes: 91 additions & 0 deletions logical/float.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>logical values for float</title>
<link rel="stylesheet" href="../css-cookbook/styles.css">
<style>

.container {
display: flex;
}

.box {
border: 2px solid rgb(96, 139, 168);
border-radius: 5px;
background-color: rgba(96, 139, 168, .2);
padding: 10px;
margin: 10px;
width: 100px;
height: 100px;
}


</style>

<style class="editable">
.inner {
writing-mode: horizontal-tb;
}

.physical {
float: left;
}

.logical {
float: inline-start;
}
</style>
</head>

<body>
<section class="preview">
<div class="container">
<div class="inner">
<div class="physical box"></div>
Turnip greens yarrow ricebean rutabaga endive cauliflower sea lettuce kohlrabi amaranth water spinach
avocado daikon napa cabbage asparagus winter purslane kale.
<div class="inner">
<div class="logical box"></div>
Turnip greens yarrow ricebean rutabaga endive cauliflower sea lettuce kohlrabi amaranth water
spinach
avocado daikon napa cabbage asparagus winter purslane kale.
</div>
</div>
</section>

<textarea class="playable playable-css" style="height: 240px;">
.inner {
writing-mode: horizontal-tb;
}

.physical {
float: left;
}

.logical {
float: inline-start;
}</textarea>

<textarea class="playable playable-html" style="height: 180px;">
<div class="container">
<div class="inner">
<div class="physical box"></div>
Turnip greens yarrow ricebean rutabaga endive cauliflower sea lettuce kohlrabi amaranth water spinach avocado daikon napa cabbage asparagus winter purslane kale.
</div>
<div class="inner">
<div class="logical box"></div>
Turnip greens yarrow ricebean rutabaga endive cauliflower sea lettuce kohlrabi amaranth water spinach avocado daikon napa cabbage asparagus winter purslane kale.
</div>
</div>
</textarea>


<div class="playable-buttons">
<input id="reset" type="button" value="Reset">
</div>
</body>
<script src="../css-cookbook/playable.js"></script>

</html>
120 changes: 120 additions & 0 deletions logical/margin-longhands.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>Margin Longhands</title>
<link rel="stylesheet" href="../css-cookbook/styles.css">
<style>

.container {
display: flex;
}
.inner {
border: 2px dotted grey;
}
.box {
border: 2px solid rgb(96, 139, 168);
border-radius: 5px;
background-color: rgba(96, 139, 168, .2);
padding: 10px;
width: 220px;
height:220px;
}


</style>

<style class="editable">
.box {
writing-mode: horizontal-tb;
direction: ltr;
}

.physical {
margin-top: 5px;
margin-right: 0;
margin-bottom: 2em;
margin-left: 50px;
}

.logical {
margin-block-start: 5px;
margin-inline-end: 0;
margin-block-end: 2em;
margin-inline-start: 50px;
}
</style>
</head>

<body>
<section class="preview">
<div class="container">
<div class="inner">
<div class="physical box">
margin-top: 5px<br>
margin-right: 0<br>
margin-bottom: 2em<br>
margin-left: 50px
</div>
</div>
<div class="inner">
<div class="logical box">
margin-block-start: 5px<br>
margin-inline-end: 0<br>
margin-block-end: 2em<br>
margin-inline-start: 50px
</div>
</div>
</div>
</section>

<textarea class="playable playable-css" style="height: 320px;">
.box {
writing-mode: horizontal-tb;
direction: ltr;
}

.physical {
margin-top: 5px;
margin-right: 0;
margin-bottom: 2em;
margin-left: 50px;
}

.logical {
margin-block-start: 5px;
margin-inline-end: 0;
margin-block-end: 2em;
margin-inline-start: 50px;
}</textarea>

<textarea class="playable playable-html" style="height: 340px;">
<div class="container">
<div class="inner">
<div class="physical box">
margin-top: 5px<br>
margin-right: 0<br>
margin-bottom: 2em<br>
margin-left: 50px
</div>
</div>
<div class="inner">
<div class="logical box">
margin-block-start: 5px<br>
margin-inline-end: 0<br>
margin-block-end: 2em<br>
margin-inline-start: 50px
</div>
</div>
</div>
</textarea>


<div class="playable-buttons">
<input id="reset" type="button" value="Reset">
</div>
</body>
<script src="../css-cookbook/playable.js"></script>

</html>
Loading

0 comments on commit 5c294a3

Please sign in to comment.