This repository has been archived by the owner on Mar 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
_config.scss
92 lines (69 loc) · 2.36 KB
/
_config.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// SassyIcons: configuration
// -------------------------
////
//// @group config
////
/// Default settings.
///
/// @type Map
///
/// @prop {Number} spacing [0] - Space around sprites in generated spritemap
/// @prop {String} dir ['icons'] - Main icons directory. `sprite-map-create[]`, base for sub dirs
/// @prop {String} dir-png ['png'] - Name of the png sub-folders
/// @prop {String} dir-hidpi ['png_2x'] - Name of the hidpi png sub-folders
/// @prop {Number} hidpi-scale [2] - Scale of the hidpi pngs
/// @prop {Number} hidpi-ratio [1.3] - Minimum resolution ratio used in the hidpi media query
/// @prop {Boolean} single-embed [true] - Whether to embed icons as data URI in the `icon-single[]` mixin
/// @prop {String} format ['svg'] - Default file format unless overridden by parameter, svg | png
/// @prop {Boolean} legacy [true] - Whether to support legacy browsers, svg fallback
$icons-defaults: (
// Space around sprites in generated spritemap.
// Useful with `$offset` parameter.
// This setting is global for all spritemaps.
// Can be set per spritemap with the `$spacing` parameter.
spacing: 0,
// Main icons directory. `sprite-map-create()`, base for sub dirs.
dir: "icons",
// Name of the png sub-folders.
dir-png: "png",
// Name of the hidpi png sub-folders.
dir-hidpi: "png_2x",
// Scale of the hidpi pngs.
hidpi-scale: 2,
// Minimum resolution ratio used in the hidpi media query.
hidpi-ratio: 1.3,
// Whether to embed icons as data URI in the `icon-single()` mixin.
single-embed: true,
// Default file format unless overridden by parameter, svg | png.
format: "svg",
// Whether to support legacy browsers, svg fallback.
legacy: true
);
/// User settings.
/// Instanciate the same object in your stylesheets to override defaults.
///
/// @type Map
///
/// @example scss Override defaults
/// $icons-settings: (
/// dir: "assets",
/// hidpi-scale: 3
/// );
$icons-settings: () !default;
/// Retrieve a configuration item.
///
/// @access private
///
/// @requires {variable} icons-defaults
/// @requires {variable} icons-settings
///
/// @param {String} $key - configuration item key
///
/// @return {*}
@function conf($key) {
@if not map-has-key($icons-defaults, $key) {
@warn "No item `#{$key}` found in configuration.";
@return false;
}
@return map-get(map-merge($icons-defaults, $icons-settings), $key);
}