forked from sass/sass-site
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request sass#50 from oddbird/dynamic-nav
Generate doc tocs dynamically.
- Loading branch information
Showing
36 changed files
with
2,665 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
toc: | ||
- Syntax: /documentation/syntax/ | ||
:children: | ||
- Parsing a Stylesheet: /documentation/syntax/parsing/ | ||
- Structure of a Stylesheet: /documentation/syntax/structure/ | ||
- Comments: /documentation/syntax/comments/ | ||
- Special Functions: /documentation/syntax/special-functions/ | ||
- Style Rules: /documentation/style-rules/ | ||
:children: | ||
- Property Declarations: /documentation/style-rules/declarations/ | ||
- Parent Selector: /documentation/style-rules/parent-selector/ | ||
- Placeholder Selectors: /documentation/style-rules/placeholder-selectors/ | ||
- Variables: /documentation/variables/ | ||
- Interpolation: /documentation/interpolation/ | ||
- At-Rules: /documentation/at-rules/ | ||
:children: | ||
- '`@use`': /documentation/at-rules/use/ | ||
- '`@forward`': /documentation/at-rules/forward/ | ||
- '`@import`': /documentation/at-rules/import/ | ||
- '`@mixin` and `@include`': /documentation/at-rules/mixin/ | ||
- '`@function`': /documentation/at-rules/function/ | ||
- '`@extend`': /documentation/at-rules/extend/ | ||
- '`@error`': /documentation/at-rules/error/ | ||
- '`@warn`': /documentation/at-rules/warn/ | ||
- '`@debug`': /documentation/at-rules/debug/ | ||
- '`@at-root`': /documentation/at-rules/at-root/ | ||
- Flow Control: /documentation/at-rules/control/ | ||
:children: | ||
- '`@if` and `@else`': /documentation/at-rules/control/if/ | ||
- '`@each`': /documentation/at-rules/control/each/ | ||
- '`@for`': /documentation/at-rules/control/for/ | ||
- '`@while`': /documentation/at-rules/control/while/ | ||
- From CSS: /documentation/at-rules/css/ | ||
- Values: /documentation/values/ | ||
:children: | ||
- Numbers: /documentation/values/numbers/ | ||
- Strings: /documentation/values/strings/ | ||
- Colors: /documentation/values/colors/ | ||
- Lists: /documentation/values/lists/ | ||
- Maps: /documentation/values/maps/ | ||
- '`true` and `false`': /documentation/values/booleans/ | ||
- '`null`': /documentation/values/null/ | ||
- Calculations: /documentation/values/calculations/ | ||
- Functions: /documentation/values/functions/ | ||
- Operators: /documentation/operators/ | ||
:children: | ||
- Equality: /documentation/operators/equality/ | ||
- Relational: /documentation/operators/relational/ | ||
- Numeric: /documentation/operators/numeric/ | ||
- String: /documentation/operators/string/ | ||
- Boolean: /documentation/operators/boolean/ | ||
- Built-In Modules: /documentation/modules/ | ||
:children: | ||
- '`sass:color`': /documentation/modules/color/ | ||
- '`sass:list`': /documentation/modules/list/ | ||
- '`sass:map`': /documentation/modules/map/ | ||
- '`sass:math`': /documentation/modules/math/ | ||
- '`sass:meta`': /documentation/modules/meta/ | ||
- '`sass:selector`': /documentation/modules/selector/ | ||
- '`sass:string`': /documentation/modules/string/ | ||
- Breaking Changes: /documentation/breaking-changes/ | ||
:children: | ||
- Strict Unary Operators: /documentation/breaking-changes/strict-unary/ | ||
- Random With Units: /documentation/breaking-changes/random-with-units/ | ||
- Invalid Combinators: /documentation/breaking-changes/bogus-combinators/ | ||
- Media Queries Level 4: /documentation/breaking-changes/media-logic/ | ||
- '`/` as Division': /documentation/breaking-changes/slash-div/ | ||
- Function Units: /documentation/breaking-changes/function-units/ | ||
- '`-moz-document`': /documentation/breaking-changes/moz-document/ | ||
- Extending Compound Selectors: /documentation/breaking-changes/extend-compound/ | ||
- CSS Variable Syntax: /documentation/breaking-changes/css-vars/ | ||
- Command Line: /documentation/cli/ | ||
:children: | ||
- Dart Sass: /documentation/cli/dart-sass/ | ||
- Ruby Sass: /documentation/cli/ruby-sass/ | ||
- Migrator: /documentation/cli/migrator/ | ||
- JavaScript API: /documentation/js-api/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<ul> | ||
{%- if parent_href -%} | ||
<li class="overview"> | ||
<a href="{{ parent_href }}" {% if url == parent_href %}class="selected"{% endif %}>Overview</a> | ||
</li> | ||
{%- endif -%} | ||
{%- for section in toc -%} | ||
{%- assign link = section | getDocTocData -%} | ||
{%- assign children = section[':children'] -%} | ||
{%- assign is_open = url == '' and link.expanded -%} | ||
<li> | ||
<a href="{{ link.href }}" class="{% if children %}section {% endif %}{% if url | startsWith: link.href %}open selected{% elsif is_open %}open{% endif %}">{{ link.text }}</a> | ||
{%- if children -%} | ||
{% render 'documentation_toc', url: url, toc: children, parent_href: link.href %} | ||
{%- endif -%} | ||
</li> | ||
{%- endfor -%} | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{% codeExample 'nesting' %} | ||
nav { | ||
ul { | ||
margin: 0; | ||
padding: 0; | ||
list-style: none; | ||
} | ||
|
||
li { display: inline-block; } | ||
|
||
a { | ||
display: block; | ||
padding: 6px 12px; | ||
text-decoration: none; | ||
} | ||
} | ||
=== | ||
nav | ||
ul | ||
margin: 0 | ||
padding: 0 | ||
list-style: none | ||
|
||
li | ||
display: inline-block | ||
|
||
a | ||
display: block | ||
padding: 6px 12px | ||
text-decoration: none | ||
{% endcodeExample %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{% codeExample 'use-with' %} | ||
// _library.scss | ||
$black: #000 !default; | ||
$border-radius: 0.25rem !default; | ||
$box-shadow: 0 0.5rem 1rem rgba($black, 0.15) !default; | ||
|
||
code { | ||
border-radius: $border-radius; | ||
box-shadow: $box-shadow; | ||
} | ||
--- | ||
// style.scss | ||
@use 'library' with ( | ||
$black: #222, | ||
$border-radius: 0.1rem | ||
); | ||
=== | ||
// _library.sass | ||
$black: #000 !default | ||
$border-radius: 0.25rem !default | ||
$box-shadow: 0 0.5rem 1rem rgba($black, 0.15) !default | ||
|
||
code | ||
border-radius: $border-radius | ||
box-shadow: $box-shadow | ||
--- | ||
// style.sass | ||
@use 'library' with ($black: #222, $border-radius: 0.1rem) | ||
=== | ||
code { | ||
border-radius: 0.1rem; | ||
box-shadow: 0 0.5rem 1rem rgba(34, 34, 34, 0.15); | ||
} | ||
{% endcodeExample %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.