-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(code-snippet): Update templates (#779)
* fix(code-snippet): Update skeleton state styles * fix: swap code and pre tag nesting order * fix(code-snippet): Update hbs template for code snippet * fix: spelling error * chore: remove old files * chore: move changes from PR 774 to this * fix: Update click event to run on button
- Loading branch information
1 parent
dad879b
commit 7032581
Showing
13 changed files
with
159 additions
and
139 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
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 |
---|---|---|
@@ -1,36 +1,54 @@ | ||
<div class="bx--snippet bx--snippet--{{variant}}"> | ||
<div class="bx--snippet-container"> | ||
{{#is variant "code"}} | ||
<code> | ||
<pre> | ||
@mixin bx--snippet($type) { | ||
@if $type == 'terminal' { | ||
background-color: red; | ||
} @else if $type == 'code' { | ||
background-color: blue; | ||
} @else if $type == 'text' { | ||
background-color: white; | ||
} | ||
{{#is variant "inline"}} | ||
<p>Here is an example of a text that a user would be reading. In this paragraph would be | ||
<button data-copy-btn="" class="bx--snippet bx--snippet--inline {{#if light}} bx--snippet--light{{/if}}" aria-label="Copy code" tabindex="0"> | ||
<code>inline code</code> | ||
<div class="bx--btn--copy__feedback" data-feedback="Copied!"></div> | ||
</button> | ||
that the user could look at and copy in to their code editor.</p> | ||
{{else}} | ||
|
||
<div class="bx--snippet bx--snippet--{{variant}}" {{#is variant "multi"}}data-code-snippet{{/is}}> | ||
<div class="bx--snippet-container"> | ||
|
||
@if $type == 'terminal' { | ||
background-color: red; | ||
} @else if $type == 'code' { | ||
background-color: blue; | ||
} @else if $type == 'text' { | ||
background-color: white; | ||
<pre> | ||
<code> | ||
@mixin grid-container { | ||
width: 100%; | ||
padding-right: padding(mobile); | ||
padding-left: padding(mobile); | ||
|
||
@include breakpoint(bp--xs--major) { | ||
padding-right: padding(xs); | ||
padding-left: padding(xs); | ||
} | ||
} | ||
} | ||
</pre> | ||
</code> | ||
{{else}} | ||
<pre><code>node -v Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis, veritatis voluptate id incidunt molestiae officia possimus, quasi itaque alias, architecto hic, dicta fugit? Debitis delectus quidem explicabo vitae fuga laboriosam!</code></pre> | ||
|
||
$z-indexes: ( | ||
modal : 9000, | ||
overlay : 8000, | ||
dropdown : 7000, | ||
header : 6000, | ||
footer : 5000, | ||
hidden : - 1, | ||
overflowHidden: - 1, | ||
floating: 10000 | ||
); | ||
|
||
</code> | ||
</pre> | ||
</div> | ||
<button data-copy-btn class="bx--snippet-button" aria-label="Copy code" tabindex="0"> | ||
<svg class="bx--snippet__icon" width="18" height="24" viewBox="0 0 18 24" fill-rule="evenodd"> | ||
<path d="M13 5V0H0v19h5v5h13V5h-5zM2 17V2h9v3H5v12H2zm14 5H7V7h9v15z"></path> | ||
<path d="M9 9h5v2H9zM9 12h5v2H9zM9 15h3v2H9z"></path> | ||
</svg> | ||
<div class="bx--btn--copy__feedback" data-feedback="Copied!"></div> | ||
</button> | ||
{{#is variant "multi"}} | ||
<button class="bx--btn bx--btn--ghost bx--btn--sm bx--snippet-btn--expand" type="button"> | ||
<span class="bx--snippet-btn--text" data-show-more-text="Show more" data-show-less-text="Show less">Show more</span> | ||
<svg class="bx--icon-chevron--down" width='12' height='8' viewBox='0 0 12 8' fill-rule='evenodd' aria-label="Show more icon" alt="Show more icon"><title>Show more icon</title><path d='M10.6 0L6 4.7 1.4 0 0 1.4l6 6.1 6-6.1z'></path></svg> | ||
</button> | ||
{{/is}} | ||
</div> | ||
<button data-copy-btn class="bx--snippet-button" aria-label="Copy code" tabindex="0"> | ||
<svg class="bx--snippet__icon" width="18" height="24" viewBox="0 0 18 24" fill-rule="evenodd"> | ||
<path d="M13 5V0H0v19h5v5h13V5h-5zM2 17V2h9v3H5v12H2zm14 5H7V7h9v15z"></path> | ||
<path d="M9 9h5v2H9zM9 12h5v2H9zM9 15h3v2H9z"></path> | ||
</svg> | ||
<div class="bx--btn--copy__feedback" data-feedback="Copied!"></div> | ||
</button> | ||
</div> | ||
{{/is}} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.