Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
---
2
layout: docs
3
title: "Spacing"
4
description: Moodle spacing
5
date: 2020-02-04T09:40:32+01:00
6
draft: false
7
weight: 4
8
---
9
 
10
## How it works
11
 
12
Moodle's spacing classes build on Bootstrap spacing classes which can be set for margins and paddings on different screen breakpoints. Using these classes is preferred over setting custom spacing on UI elements using CSS.
13
 
14
### example class pt-3
15
 
16
class: ```pt-3:```
17
 
18
result: padding-top-three
19
 
20
css:
21
{{< highlight css >}}
22
.pt-3 {
23
  padding-top: 1rem; /** 16px **/
24
}
25
{{< /highlight >}}
26
 
27
The classes are named using the format `{property}{sides}-{size}` for `xs` and `{property}{sides}-{breakpoint}-{size}` for `sm`, `md`, `lg`, and `xl`.
28
 
29
### Moodle spacing values
30
 
31
Moodle add's a 6th spacing value on top of the Bootstrap default spacing.
32
 
33
* `0` - for classes that eliminate the `margin` or `padding` by setting it to `0`
34
* `1` - (by default) for classes that set the `margin` or `padding` to `$spacer * .25`
35
* `2` - (by default) for classes that set the `margin` or `padding` to `$spacer * .5`
36
* `3` - (by default) for classes that set the `margin` or `padding` to `$spacer`
37
* `4` - (by default) for classes that set the `margin` or `padding` to `$spacer * 1.5`
38
* `5` - (by default) for classes that set the `margin` or `padding` to `$spacer * 2`
39
* `6` - (by default) for classes that set the `margin` or `padding` to `$spacer * 3`
40
* `auto` - for classes that set the `margin` to auto
41
 
42
### Example of paddings
43
 
44
{{< example>}}
45
<div class="d-flex align-items-center justify-content-center">
46
  <div class="p-6 bg-dark">
47
    <div class="p-5 bg-white">
48
      <div class="p-4 bg-info">
49
        <div class="p-3 bg-success">
50
          <div class="p-2 bg-warning">
51
            <div class="p-1 bg-danger">
52
            </div>
53
          </div>
54
        </div>
55
      </div>
56
    </div>
57
  </div>
58
</div>
59
{{< /example >}}