Skip to content

Commit

Permalink
fixes #974 - make the striped background on readonly an opt-out feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Yair Even Or authored and Yair Even Or committed Feb 5, 2022
1 parent cf2be53 commit 4894c53
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
6 changes: 4 additions & 2 deletions README.md
Expand Up @@ -801,6 +801,7 @@ For a *live* example, see the [demos page](https://yaireo.github.io/tagify/#sect
Name | Info
------------------------------- | --------------------------------
--tags-disabled-bg | Tag background color when *disabled*
--tags-border-color | The outer border color which surrounds tagify
--tags-hover-border-color | *hover* state
--tags-focus-border-color | *focus* state
Expand All @@ -818,11 +819,12 @@ Name | Info
--tag-remove-btn-color | Remove (`脳`) button text color
--tag-remove-btn-bg | Remove (`脳`) button background color
--tag-remove-btn-bg--hover | Remove (`脳`) button hover background color
--loader-size | Loading animation size. `1em` is pretty big, default is a bit less.
--input-color | Input text color
--tag-hide-transition | Controls the transition property when a tag is removed. default is '.3s'
--placeholder-color | Placeholder text color
--placeholder-color-focus | Placeholder text color when Tagify has focus and no input was typed
--input-color | Input text color
--loader-size | Loading animation size. `1em` is pretty big, default is a bit less.
--readonly-striped | Either a value `1` or `0` can be used to toggle the striped diagonal background in *readonly*
### Full list of Tagify's [SCSS variables](https://github.com/yairEO/tagify/blob/master/src/tagify.scss#L9-L24)
Expand Down
13 changes: 10 additions & 3 deletions src/tagify.scss
Expand Up @@ -57,6 +57,7 @@
--placeholder-color : #{$placeholder-color};
--placeholder-color-focus : #{$placeholder-color-focus};
--loader-size : .8em;
--readonly-striped : 1;

@mixin firefox {
@at-root {
Expand Down Expand Up @@ -94,15 +95,21 @@
}

@mixin tagReadonlyBG($size:5px){
background: linear-gradient(45deg, var(--tag-bg) 25%,
animation: readonlyStyles 1s calc(-1s * (var(--readonly-striped) - 1)) paused;

@keyframes readonlyStyles {
0% {
background: linear-gradient(45deg, var(--tag-bg) 25%,
transparent 25%,
transparent 50%,
var(--tag-bg) 50%,
var(--tag-bg) 75%,
transparent 75%,
transparent) 0/#{$size} #{$size};
box-shadow: none;
filter: brightness(.95);
box-shadow: none;
filter: brightness(.95);
}
}
}

@keyframes tags--bump{
Expand Down

0 comments on commit 4894c53

Please sign in to comment.