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: Colors
4
description: Convey meaning through color with a handful of color utility classes. Includes support for styling links with hover states, too.
5
group: utilities
6
toc: true
7
---
8
 
9
{{< callout info >}}
10
#### Dealing with specificity
11
 
12
Sometimes contextual classes cannot be applied due to the specificity of another selector. In some cases, a sufficient workaround is to wrap your element's content in a `<div>` with the class.
13
{{< /callout >}}
14
 
15
{{< callout warning >}}
16
{{< partial "callout-warning-color-assistive-technologies.md" >}}
17
{{< /callout >}}
18
 
19
## Color
20
 
21
{{< example >}}
22
{{< colors.inline >}}
23
{{- range (index $.Site.Data "theme-colors") }}
24
<p class="text-{{ .name }}{{ if eq .name "light" }} bg-dark{{ end }}">.text-{{ .name }}</p>
25
{{- end -}}
26
{{< /colors.inline >}}
27
<p class="text-body">.text-body</p>
28
<p class="text-muted">.text-muted</p>
29
<p class="text-white bg-dark">.text-white</p>
30
<p class="text-black-50">.text-black-50</p>
31
<p class="text-white-50 bg-dark">.text-white-50</p>
32
{{< /example >}}
33
 
34
Contextual text classes also work well on anchors with the provided hover and focus states. **Note that the `.text-white` and `.text-muted` class has no additional link styling beyond underline.**
35
 
36
{{< example >}}
37
{{< colors.inline >}}
38
{{- range (index $.Site.Data "theme-colors") }}
39
<p><a href="#" class="text-{{ .name }}{{ if eq .name "light" }} bg-dark{{ end }}">{{ .name | title }} link</a></p>
40
{{- end -}}
41
{{< /colors.inline >}}
42
<p><a href="#" class="text-muted">Muted link</a></p>
43
<p><a href="#" class="text-white bg-dark">White link</a></p>
44
{{< /example >}}
45
 
46
## Background color
47
 
48
Similar to the contextual text color classes, easily set the background of an element to any contextual class. Anchor components will darken on hover, just like the text classes. Background utilities **do not set `color`**, so in some cases you'll want to use `.text-*` utilities.
49
 
50
{{< example >}}
51
{{< colors.inline >}}
52
{{- range (index $.Site.Data "theme-colors") }}
53
<div class="p-3 mb-2 bg-{{ .name }} {{ if or (eq .name "light") (eq .name "warning") }}text-dark{{ else }}text-white{{ end }}">.bg-{{ .name }}</div>
54
{{- end -}}
55
{{< /colors.inline >}}
56
<div class="p-3 mb-2 bg-white text-dark">.bg-white</div>
57
<div class="p-3 mb-2 bg-transparent text-dark">.bg-transparent</div>
58
{{< /example >}}
59
 
60
## Background gradient
61
 
62
When `$enable-gradients` is set to `true` (default is `false`), you can use `.bg-gradient-` utility classes. [Learn about our Sass options]({{< docsref "/getting-started/theming#sass-options" >}}) to enable these classes and more.
63
 
64
{{< markdown >}}
65
{{< colors.inline >}}
66
{{- range (index $.Site.Data "theme-colors") }}
67
- `.bg-gradient-{{ .name }}`
68
{{- end -}}
69
{{< /colors.inline >}}
70
{{< /markdown >}}