mostly filebased Content Presentation System

_version.scss 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Release Management in Susy
  2. // ==========================
  3. // Susy Version [variable]
  4. // -----------------------
  5. /// The current version of Susy being used.
  6. /// - We will release a major version for any BREAKING changes.
  7. /// - We will release a minor version for any significant NEW features.
  8. /// - We will release a patch for any BUGFIX changes.
  9. ///
  10. /// @group _version
  11. /// @access private
  12. /// @since 3.0.1
  13. ///
  14. /// @prop {integer} 'major' - the major release number
  15. /// @prop {integer} 'minor' - the minor release number
  16. /// @prop {integer} 'patch' - the patch number
  17. $_susy-version: (
  18. 'major': 3,
  19. 'minor': 0,
  20. 'patch': 1,
  21. );
  22. // Susy Version [function]
  23. // -----------------------
  24. /// Returns the current version of Susy
  25. /// as a string in the common `major.minor.patch` format –
  26. /// or returns one part (major | minor | patch) as a number
  27. /// for version comparisons.
  28. /// Since version numbers aren't actual decimals,
  29. /// there is no simple way to return the full version
  30. /// as a comparable number in Sass.
  31. ///
  32. /// @group _version
  33. ///
  34. /// @param {'major' | 'minor' | 'patch'} $part [null] -
  35. /// The part (major | minor | patch) to return as a number.
  36. /// Any other value will return the full version as a string.
  37. /// @example scss - Current Susy Version
  38. /// /* Full Version: #{susy-version()} */
  39. /// /* Major Release: #{susy-version('major')} */
  40. @function susy-version(
  41. $part: null
  42. ) {
  43. $major: map-get($_susy-version, 'major');
  44. $minor: map-get($_susy-version, 'minor');
  45. $patch: map-get($_susy-version, 'patch');
  46. $full: '#{$major}.#{$minor}.#{$patch}';
  47. @return map-get($_susy-version, $part) or $full;
  48. }