-
-
Notifications
You must be signed in to change notification settings - Fork 348
/
_version.scss
53 lines (48 loc) · 1.6 KB
/
_version.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
// Release Management in Susy
// ==========================
// Susy Version [variable]
// -----------------------
/// The current version of Susy being used.
/// - We will release a major version for any BREAKING changes.
/// - We will release a minor version for any significant NEW features.
/// - We will release a patch for any BUGFIX changes.
///
/// @group _version
/// @access private
/// @since 3.0.1
///
/// @prop {integer} 'major' - the major release number
/// @prop {integer} 'minor' - the minor release number
/// @prop {integer} 'patch' - the patch number
$_susy-version: (
'major': 3,
'minor': 0,
'patch': 6,
);
// Susy Version [function]
// -----------------------
/// Returns the current version of Susy
/// as a string in the common `major.minor.patch` format –
/// or returns one part (major | minor | patch) as a number
/// for version comparisons.
/// Since version numbers aren't actual decimals,
/// there is no simple way to return the full version
/// as a comparable number in Sass.
///
/// @group _version
///
/// @param {'major' | 'minor' | 'patch'} $part [null] -
/// The part (major | minor | patch) to return as a number.
/// Any other value will return the full version as a string.
/// @example scss - Current Susy Version
/// /* Full Version: #{susy-version()} */
/// /* Major Release: #{susy-version('major')} */
@function susy-version(
$part: null
) {
$major: map-get($_susy-version, 'major');
$minor: map-get($_susy-version, 'minor');
$patch: map-get($_susy-version, 'patch');
$full: '#{$major}.#{$minor}.#{$patch}';
@return map-get($_susy-version, $part) or $full;
}