Files
notifications-admin/app/assets/stylesheets/components/textbox.scss
Chris Hill-Scott b73e42650d Refactor hex colour preview Javascript
This commit improves the code that previews a hex colour when setting up
or changing an email branding.

Specifically it:
- refactors the Javascript to conform to our patterns (module pattern,
  preprocessed with Gulp)
- makes the code work when there are multiple colour previews on one
  page

It also does some visual prettifying, because I couldn’t help myself…
2018-08-22 16:31:05 +01:00

75 lines
1.2 KiB
SCSS

.textbox-highlight {
$tag-background: rgba($light-blue, 0.6);
&-wrapper {
position: relative;
}
&-textbox {
resize: none;
z-index: 20;
background: none;
}
&-textbox,
&-background,
&-foreground,
&-mask {
font-size: 19px;
display: block;
box-sizing: border-box;
position: relative;
margin: 0;
padding: 4px;
overflow: hidden;
line-height: 1.6;
}
&-background {
position: absolute;
top: 0;
left: 0;
pointer-events: none;
color: transparent;
white-space: pre-wrap;
overflow-wrap: break-word;
word-wrap: break-word;
border: 2px solid transparent;
padding-bottom: $gutter-half;
z-index: 10;
.placeholder {
color: transparent;
}
}
}
.textbox-help-link {
margin: 10px 0 0 0;
}
.textbox-right-aligned {
text-align: right;
}
.extra-tracking .form-control {
padding-left: 5px;
letter-spacing: 0.04em;
}
.textbox-colour-preview {
@include media(desktop) {
width: 38px;
height: 38px;
margin-left: 5px;
border-radius: 50%;
box-shadow: inset 0 0 0 1px rgba($black, 0.2);
display: inline-block;
vertical-align: top;
transition: background 0.3s ease-out;
}
}