// styleguide // @category styleguide // interface for the styleguide references // @mixin styleguide // @param $is ... $is-10 {List} a descriptive definition of the element, must contain an ID and optionally any modifiers e.g. `large primary button` // @param $exclude {List} a list of styles to exclude from output // @param $state {String} a specific state to output // @param $theme {String} the theme name // @param $here {Boolean} if true, will force the content to be output in the current context, and not extended // @content @mixin styleguide($is: (), $is-2: false, $is-3: false, $is-4: false, $is-5: false, $is-6: false, $is-7: false, $is-8: false, $is-9: false, $is-10: false, $exclude: (), $state: null, $theme: $CONFIG_THEME, $here: null) { $definition: compact($is, $is-2, $is-3, $is-4, $is-5, $is-6, $is-7, $is-8, $is-9, $is-10); @if length($definition) > 0 { $styles: _styleguide($definition, $state, $theme); // output the styles $archetype-origin-function: styleguide !global; @include to-styles($styles, $exclude: $exclude, $here: $here) { @content; }; $archetype-origin-function: null !global; } } // returns the styleguide object // @function styleguide // @param $is ... $is-10 {List} a descriptive definition of the element, must contain an ID and optionally any modifiers e.g. `large primary button` // @param $exclude {List} a list of styles to exclude from output // @param $state {String} a specific state to output // @param $theme {String} the theme name @function styleguide($is: (), $is-2: false, $is-3: false, $is-4: false, $is-5: false, $is-6: false, $is-7: false, $is-8: false, $is-9: false, $is-10: false, $exclude: (), $state: null, $theme: $CONFIG_THEME) { $definition: compact($is, $is-2, $is-3, $is-4, $is-5, $is-6, $is-7, $is-8, $is-9, $is-10); @return _styleguide($definition, $state, $theme); } // output the difference between two styelguide invocations // @mixin styleguide-diff // @param $original {List} the original styleguide reference to compare to // @param $other {List} the other styleguide reference // @param $exclude {List} a list of styles to exclude from output // @param $theme {String} the theme name // @content @mixin styleguide-diff($original, $other, $exclude: ()) { $diff: styleguide-diff($original, $other); @if length($diff) > 0 { // output the styles $archetype-origin-function: styleguide-diff !global; @include to-styles($diff, $exclude: $exclude, $meta: (origin: styleguide-diff)) { @content; }; $archetype-origin-function: null !global; } } // checks to see whether or not a component should be registered // @function should-register-component // @param $component-id {String} the component identifier // @param $extension-id {String} the extension identifier // @return {Boolean} whether or not the component should be registered @function should-register-component($component-id, $extension-id: null) { $component-exists: if($extension-id, styleguide-component-exists($component-id, $CONFIG_THEME), styleguide-component-exists($component-id, $CONFIG_THEME, $extension-id)); $component-excluded: index($CONFIG_THEME_EXCLUDE, $component-id); @return not ($component-exists or $component-excluded); }