Skip to content

Commit

Permalink
fix: make the docs comments optional
Browse files Browse the repository at this point in the history
  • Loading branch information
zastrow committed Nov 21, 2020
1 parent d9e3cfc commit fe22a55
Show file tree
Hide file tree
Showing 98 changed files with 1,538 additions and 1,339 deletions.
3 changes: 3 additions & 0 deletions _utilities.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* BEGIN: Sparkle Utility Classes */

// Utilities
@import "utilities/display/utility";
@import "utilities/position/utility";
Expand All @@ -14,3 +16,4 @@
@import "utilities/flex-shrink/utility";
@import "utilities/flex-wrap/utility";

/* END: Sparkle Utility Classes */
80 changes: 41 additions & 39 deletions globals/media-queries/_docs.scss
Original file line number Diff line number Diff line change
@@ -1,54 +1,56 @@
@if settings(loop-mq) {
/* ---
title: Media Queries System
section: Systems
---
@if $sparkle-show-docs {
/* ---
title: Media Queries System
section: Systems
---
The media queries of this system are not intended to be the only media queries in your styles, but are meant to be the major media queries and inform the responsive suffixes that are applied to the utility classes.
The media queries of this system are not intended to be the only media queries in your styles, but are meant to be the major media queries and inform the responsive suffixes that are applied to the utility classes.
### Media Queries Function
### Media Queries Function
```scss
@media (min-width: mq(<key>)) {
...
}
```
```scss
@media (min-width: mq(<key>)) {
...
}
```
### Responsive Suffix Classes
### Responsive Suffix Classes
Responsive suffix classes scope a utility class’s styles to a media query. For example a class named `.display-block` add the property and value of `display: block`, it will have a companion class called `.display-block@md` that applies `display: block` only when the screen width is at the defined size for the `md` media query key.
Responsive suffix classes scope a utility class’s styles to a media query. For example a class named `.display-block` add the property and value of `display: block`, it will have a companion class called `.display-block@md` that applies `display: block` only when the screen width is at the defined size for the `md` media query key.
### Framework Media Queries
### Framework Media Queries
The following table contains a list of the media query values defined in this framework.
The following table contains a list of the media query values defined in this framework.
<table>
<title>Framework Media Queries</title>
<thead>
<tr>
<th>Function</th>
<th>Screen Width Size</th>
<th>Class Suffix</th>
</tr>
</thead>
<tbody>
*/

@each $key, $val in $media-queries {
/* ---
section: Systems
---
<tr>
<td>mq(#{$key})</td>
<td>#{$val}</td>
<td>@#{$key}</td>
</tr>
*/
}

<table>
<title>Framework Media Queries</title>
<thead>
<tr>
<th>Function</th>
<th>Screen Width Size</th>
<th>Class Suffix</th>
</tr>
</thead>
<tbody>
*/
@each $key, $val in $media-queries {
/* ---
section: Systems
---
<tr>
<td>mq(#{$key})</td>
<td>#{$val}</td>
<td>@#{$key}</td>
</tr>
</tbody>
</table>
*/
}

/* ---
section: Systems
---
</tbody>
</table>
*/
}
81 changes: 49 additions & 32 deletions mdcss/docs.scss
Original file line number Diff line number Diff line change
@@ -1,44 +1,61 @@
/* ---
section: Introduction
order: -1
---
// This file generates the Sparkle Docs file
// The variable below, `$sparkle-show-docs`
// turns off and on the comments used to generate
// the Docs. If this variable is set to false, the
// docs will not generate.
$sparkle-show-docs: true;

/* Begin Sparkle Docs */

@if $sparkle-show-docs {
/* ---
section: Introduction
order: -1
---
The Sparkle Utility Framework is a customizable system of Sass tools and classes that is intended to work within the Inverted Triangle CSS (ITCSS) organization method. This site is a resource of the settings, tools, and utility classes available, including documentation about what each is, how to use them, and the CSS that they'll output.
*/

/* ---
section: Settings
order: -1
---
In the ITCSS method, settings are declared first and at the top of the Sass document. These contain all variables used throughout the tools and utilities. The settings inform what Tools, Systems, and Utilities are available in the framework. More details about settings setup can be found on the [Sparkle repo](https://github.com/sparkbox/sparkle).
*/
}

The Sparkle Utility Framework is a customizable system of Sass tools and classes that is intended to work within the Inverted Triangle CSS (ITCSS) organization method. This site is a resource of the settings, tools, and utility classes available, including documentation about what each is, how to use them, and the CSS that they'll output.
*/

/* ---
section: Settings
order: -1
---
In the ITCSS method, settings are declared first and at the top of the Sass document. These contain all variables used throughout the tools and utilities. The settings inform what Tools, Systems, and Utilities are available in the framework. More details about settings setup can be found on the [Sparkle repo](https://github.com/sparkbox/sparkle).
*/
@import "../settings";

/* ---
section: Tools
order: -1
---
@if $sparkle-show-docs {
/* ---
section: Tools
order: -1
---
The second declaration of the ITCSS method are the tools. Tools are the Sass mixins and functions used throughout the framework.
*/
}

The second declaration of the ITCSS method are the tools. Tools are the Sass mixins and functions used throughout the framework.
*/
@import "../tools";
@import "mdcss";

/* ---
section: Systems
order: -1
---
@if $sparkle-show-docs {
/* ---
section: Systems
order: -1
---
Systems are not on their own part of the ITCSS organization, but instead are a collection of Settings, Tools, and Utilities. Systems are the most complex and customizable part of this framework. Each System usually has at least a Sass Function and Sass Map, while some generate Utility classes as well.
*/
}

Systems are not on their own part of the ITCSS organization, but instead are a collection of Settings, Tools, and Utilities. Systems are the most complex and customizable part of this framework. Each System usually has at least a Sass Function and Sass Map, while some generate Utility classes as well.
*/
@import "../globals/media-queries/docs";
@import "../systems";

/* ---
section: Utilities
---
The final declaration of the ITCSS method are the utilities. Any additional styles should be declared between Tools and Utilities. The utilities are classes that have distinct purposes. Some of the Utilities are part of a System. Systems contain specific mixins, functions, and utility classes around a specific aspect of the framework, for example the Color and Spacing systems.
*/
@if $sparkle-show-docs {
/* ---
section: Utilities
---
The final declaration of the ITCSS method are the utilities. Any additional styles should be declared between Tools and Utilities. The utilities are classes that have distinct purposes. Some of the Utilities are part of a System. Systems contain specific mixins, functions, and utility classes around a specific aspect of the framework, for example the Color and Spacing systems.
*/
}
@import "../utilities";

/* End Sparkle Docs */
20 changes: 10 additions & 10 deletions systems/border/position/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
border-#{$side}: $space;
}
}
@mixin sparkle-border-spacing-side-loop($mq:null, $true-test:null) {

@mixin sparkle-border-spacing-side-loop($mq:null) {
@if $mq {
$mq: '\\@' + $mq;
}

@each $side-key, $side-val in $sides {
@each $border-key, $border-val in $border-width {
@if $true-test == null {
@if $mq == null {
@if $mq == null {
@if $sparkle-show-docs {
/* ---
section: Systems
---
Expand All @@ -40,8 +40,8 @@
}
}

@mixin sparkle-border-spacing-loop($true-test:null) {
@if $true-test == null {
@mixin sparkle-border-spacing-loop {
@if $sparkle-show-docs {
/* ---
section: Systems
---
Expand All @@ -56,18 +56,18 @@
<tbody>
*/
}
@include sparkle-border-spacing-side-loop(null, $true-test);
@include sparkle-border-spacing-side-loop(null);
@each $key, $val in $media-queries {
@media (min-width: #{$val}) {
@include sparkle-border-spacing-side-loop($key, $true-test);
@include sparkle-border-spacing-side-loop($key);
}
}
@if settings('print-classes') {
@media print {
@include sparkle-border-spacing-side-loop(print, $true-test);
@include sparkle-border-spacing-side-loop(print);
}
}
@if $true-test == null {
@if $sparkle-show-docs {
/* ---
section: Systems
---
Expand Down
30 changes: 16 additions & 14 deletions systems/border/position/_test.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@import 'true';
$sparkle-show-docs: false;

@import 'mixins';
@import '../../../tools/loop-mq/mixin';

Expand Down Expand Up @@ -30,65 +32,65 @@ $sides: (
@include it('outputs the proper utility classes') {
@include assert {
@include output {
@include sparkle-border-spacing-loop(true);
@include sparkle-border-spacing-loop;
}
@include expect {
.util-border-btm-hairline {
border-bottom: 1px;
}

.util-border-top-hairline {
border-top: 1px;
}

.util-border-lft-hairline {
border-left: 1px;
}

.util-border-rgt-hairline {
border-right: 1px;
}

.util-border-all-hairline {
border: 1px;
}

.util-border-vrt-hairline {
border-right: 1px;
border-left: 1px;
}

.util-border-hrz-hairline {
border-top: 1px;
border-bottom: 1px;
}

@media (min-width: 40rem) {
.util-border-btm-hairline\@sm {
border-bottom: 1px;
}

.util-border-top-hairline\@sm {
border-top: 1px;
}

.util-border-lft-hairline\@sm {
border-left: 1px;
}

.util-border-rgt-hairline\@sm {
border-right: 1px;
}

.util-border-all-hairline\@sm {
border: 1px;
}

.util-border-vrt-hairline\@sm {
border-right: 1px;
border-left: 1px;
}

.util-border-hrz-hairline\@sm {
border-top: 1px;
border-bottom: 1px;
Expand Down
5 changes: 3 additions & 2 deletions systems/border/position/_utility.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
@import "mixins";

@if settings(utility-border-position) {
@if $sparkle-show-docs {
/* ---
title: Border System
section: Systems
---
### Border Position and Width
### Border Position and Width
*/
}
@include sparkle-border-spacing-loop();
}
10 changes: 5 additions & 5 deletions systems/border/style/_mixin.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@mixin sparkle-border-style($true-test:null) {
@if $true-test == null {
@mixin sparkle-border-style {
@if $sparkle-show-docs {
/* ---
section: Systems
---
Expand All @@ -18,7 +18,7 @@
*/
}
@each $key, $value in $border-style {
@if $true-test == null {
@if $sparkle-show-docs {
/* ---
section: Systems
---
Expand All @@ -35,12 +35,12 @@
}
}
}
@if $true-test == null {
@if $sparkle-show-docs {
/* ---
section: Systems
---
</tbody>
</table>
*/
}
}
}

0 comments on commit fe22a55

Please sign in to comment.