-
Notifications
You must be signed in to change notification settings - Fork 8
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 #1457 from sanger/sh51/add-environment-indicators
Add more environment indicators
- Loading branch information
Showing
16 changed files
with
277 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// Bare Bones Icon System | ||
|
||
// Usage: | ||
// <span class="icon icon-{name}-{color}"></span> | ||
// Where {name} is the name of the icon and {color} is the bootstrap theme color | ||
// (e.g. icon-user-primary, icon-user-secondary, icon-user-success, etc.) | ||
|
||
$icon-size: 24px; | ||
|
||
/// Replace `$search` with `$replace` in `$string` | ||
/// @author Kitty Giraudel | ||
/// @param {String} $string - Initial string | ||
/// @param {String} $search - Substring to replace | ||
/// @param {String} $replace ('') - New value | ||
/// @return {String} - Updated string | ||
@function str-replace($string, $search, $replace: '') { | ||
$index: str-index($string, $search); | ||
|
||
@if $index { | ||
@return str-slice($string, 1, $index - 1) + $replace + | ||
str-replace(str-slice($string, $index + str-length($search)), $search, $replace); | ||
} | ||
|
||
@return $string; | ||
} | ||
|
||
@mixin icon($name, $path, $theme-color) { | ||
// split theme color into name and value | ||
$theme-color-name: nth($theme-color, 1); | ||
$theme-color-value: nth($theme-color, 2); | ||
// escape characters for html | ||
$escaped-color: str-replace(inspect($theme-color-value), '#', '%23'); | ||
|
||
.icon-#{$name}-#{$theme-color-name} { | ||
display: inline-block; | ||
width: $icon-size; | ||
height: $icon-size; | ||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#{$escaped-color}" className="w-6 h-6"> #{$path} </svg>'); | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
background-size: $icon-size; | ||
} | ||
} | ||
|
||
// icons list | ||
// (add new icons here, note names must not contain dashes '-') | ||
@each $theme-color in $theme-colors { | ||
// iterate over bootstrap theme colors | ||
|
||
// icons by Heroicons https://heroicons.com/ | ||
// user-circle | ||
@include icon( | ||
'user', | ||
'<path fillRule="evenodd" d="M18.685 19.097A9.723 9.723 0 0021.75 12c0-5.385-4.365-9.75-9.75-9.75S2.25 6.615 2.25 12a9.723 9.723 0 003.065 7.097A9.716 9.716 0 0012 21.75a9.716 9.716 0 006.685-2.653zm-12.54-1.285A7.486 7.486 0 0112 15a7.486 7.486 0 015.855 2.812A8.224 8.224 0 0112 20.25a8.224 8.224 0 01-5.855-2.438zM15.75 9a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z" clipRule="evenodd" />', | ||
$theme-color | ||
); | ||
} |
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,8 +1,8 @@ | ||
<div id="flashes"> | ||
<% flash.each do |name, message| %> | ||
<div class="flash flash-<%= name %>"> | ||
<h3><%= name.titleize %></h3> | ||
<ul><% Array(message).each do |m| %><li><%= m %> <% end %></li></ul> | ||
<span class='font-weight-bold'><%= name.titleize %></span> | ||
<ul class='mb-0'><% Array(message).each do |m| %><li><%= m %> <% end %></li></ul> | ||
</div> | ||
<% end %> | ||
</div> |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.