Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
// The only class we need for icons is .icon
2
// Standardize the size, padding and alignment for all icons in Moodle.
3
 
4
// Size of default icons.
5
$icon-width: 16px;
6
$icon-height: 16px;
7
// Size of big icons.
8
$icon-medium-width: 32px;
9
$icon-medium-height: 32px;
10
// Size of big icons.
11
$icon-big-width: 64px;
12
$icon-big-height: 64px;
13
// Size of icon boxes.
14
$icon-box-width: 48px;
15
$icon-box-height: 48px;
16
 
17
// stylelint-disable
18
$iconsizes: () !default;
19
$iconsizes: map-merge((
20
  0: 0,
21
  1: ($icon-width * .25),
22
  2: ($icon-width * .5),
23
  3: $icon-width,
24
  4: ($icon-width * 1.5),
25
  5: ($icon-width * 2),
26
  6: ($icon-width * 2.5),
27
  7: ($icon-width * 3)
28
), $iconsizes);
29
// stylelint-enable
30
 
31
.icon {
32
    max-width: map-get($iconsizes, 4);
33
    max-height: map-get($iconsizes, 4);
34
    margin: 0;
35
    padding: 0;
36
    box-sizing: content-box;
37
    margin-right: 0.5rem;
38
 
39
    &.spacer {
40
        margin-right: 0;
41
    }
42
 
43
    &.iconsize-medium {
44
        font-size: $icon-medium-height;
45
        width: $icon-medium-width;
46
        height: $icon-medium-height;
47
    }
48
 
49
    &.iconsize-big {
50
        width: $icon-big-width;
51
        height: $icon-big-height;
52
        font-size: $icon-big-height;
53
    }
54
}
55
 
56
.navbar-dark a .icon {
57
    color: $navbar-dark-color !important; /* stylelint-disable-line declaration-no-important */
58
}
59
 
60
.action-menu-item a:first-of-type > .icon {
61
    margin-left: 0.5rem;
62
}
63
 
64
// YUI 2 Tree View icons must not have a margin left.
65
.ygtvcell .icon {
66
    margin-left: 0 !important; /* stylelint-disable-line declaration-no-important */
67
}
68
 
69
// In the navigation, tree icons should not have margins.
70
.block_navigation,
71
.block_settings {
72
    .tree_item .icon {
73
        margin-left: 0;
74
    }
75
}
76
 
77
[data-action=toggle-drawer] .icon {
78
    margin: 0;
79
}
80
 
81
// Apply in special cases where the default icons styles does not work properly. Eg file picker buttons.
82
.icon-no-spacing a > .icon {
83
    margin: 0;
84
}
85
 
86
.icon-no-margin {
87
    .icon {
88
        margin-left: 0;
89
        margin-right: 0;
90
        margin-top: 0;
91
        margin-bottom: 0;
92
    }
93
}
94
 
95
.icon-large > .icon {
96
    width: ($icon-width * 2);
97
    height: ($icon-height * 2);
98
}
99
 
100
@each $size, $length in $iconsizes {
101
    .icon-size-#{$size} {
102
        .icon {
103
            height: $length !important; /* stylelint-disable-line declaration-no-important */
104
            width: $length !important; /* stylelint-disable-line declaration-no-important */
105
            font-size: $length !important; /* stylelint-disable-line declaration-no-important */
106
        }
107
    }
108
}
109
 
110
.helplink .icon {
111
    margin-left: 0.5rem;
112
}
113
 
114
.icons-collapse-expand {
115
    display: flex;
116
    align-items: center;
117
    .expanded-icon {
118
        display: flex;
119
        align-items: center;
120
    }
121
 
122
    .collapsed-icon {
123
        display: none;
124
    }
125
 
126
    &.collapsed {
127
        .expanded-icon {
128
            display: none;
129
        }
130
 
131
        .collapsed-icon {
132
            display: flex;
133
            align-items: center;
134
        }
135
    }
136
}
137
 
138
// Revisit these styles when MDL-78284 lands with new icons.
139
// Icon container will be removed and icons will be used directly.
140
.activityiconcontainer {
141
    width: $activity-iconcontainer-width;
142
    height: $activity-iconcontainer-height;
143
    display: inline-flex;
144
    justify-content: center;
145
    align-items: center;
146
    border-radius: 4px;
147
    padding: 0.7rem;
148
    .activityicon,
149
    .icon {
150
        margin: 0;
151
        font-size: $icon-medium-width;
152
        height: $icon-medium-width;
153
        width: $icon-medium-height;
154
        max-height: $icon-medium-width;
155
        max-width: $icon-medium-height;
156
    }
157
    &.small {
158
        width: $activity-iconcontainer-width - 10px;
159
        height: $activity-iconcontainer-height - 10px;
160
        max-width: $activity-iconcontainer-width - 10px;
161
        max-height: $activity-iconcontainer-height - 10px;
162
    }
163
    &.smaller {
164
        width: $activity-iconcontainer-width - 20px;
165
        height: $activity-iconcontainer-width - 20px;
166
        max-width: $activity-iconcontainer-width - 20px;
167
        max-height: $activity-iconcontainer-width - 20px;
168
        .activityicon {
169
            width: $icon-medium-width;
170
            height: $icon-medium-height;
171
            max-width: $icon-medium-width;
172
            max-height: $icon-medium-height;
173
        }
174
    }
175
}
176
 
177
@each $type, $value in $activity-icon-colors {
178
    .activityiconcontainer.#{$type} {
179
        &:not(.isbranded) {
180
            .activityicon,
181
            .icon {
182
                &:not(.nofilter) {
183
                    filter: $value;
184
                }
185
            }
186
        }
187
    }
188
}
189
 
190
.icon-box {
191
    width: $icon-box-width;
192
    height: $icon-box-height;
193
    display: inline-flex;
194
    justify-content: center;
195
    align-items: center;
196
    background-color: $gray-100;
197
    border-radius: 12px;
198
    padding: 0.7rem;
199
 
200
    .icon {
201
        margin: 0;
202
        height: $icon-medium-width;
203
        width: $icon-medium-height;
204
    }
205
}
206
 
207
.icon-circle {
208
    display: inline-block;
209
    background-color: darken($gray-400, 4%);
210
    border-radius: 50%;
211
    padding: 1.3rem;
212
 
213
    .icon {
214
        margin: 0;
215
        text-align: center;
216
        max-width: unset;
217
        max-height: unset;
218
        color: $black;
219
    }
220
 
221
    &.reversed {
222
        background-color: darken($gray-400, 8%);
223
        .icon {
224
            color: $white;
225
        }
226
    }
227
}
228
 
229
// Make activtity colours available for custom modules.
230
:root {
231
    @each $type, $value in $activity-icon-colors {
232
        --activity#{$type}: #{$value};
233
    }
234
}