Skip to content

Commit

Permalink
New: Add label option
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Oct 17, 2022
1 parent 9cd6008 commit baacaeb
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 11 deletions.
11 changes: 9 additions & 2 deletions Resources/Private/Editor/src/ColorValuesEditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,27 @@
.list {
flex: 1;
position: relative;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(18px, 1fr));
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 10px;
margin-top: 10px;
padding-top: 15px;
border-top: 1px solid #3f3f3f;
}

.label {
flex: 1 0 100%;
margin-bottom: -10px;
}

.item {
border: 1px solid #3f3f3f;
border-radius: 2px;
width: 18px;
height: 18px;
cursor: pointer;
flex: 0 0 18px;
}

.item:hover,
Expand Down
12 changes: 8 additions & 4 deletions Resources/Private/Editor/src/ColorValuesEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,22 @@ export default class Editor extends PureComponent {
)}
</div>
<div className={style.list}>
{valueArray.map((item) => (
{valueArray.map((item) => {
return item.color ? (
<button
className={[
style.item,
item.color == 'transparent' && style.transparent,
].join(' ')}
item.color == "transparent" && style.transparent,
].join(" ")}
disabled={item.disabled}
style={{ backgroundColor: item.color }}
title={item.label}
onClick={() => commit(item.key)}
></button>
))}
) : (
<div className={style.label}>{item.label}</div>
);
})}
</div>
</div>
);
Expand Down
11 changes: 9 additions & 2 deletions Resources/Public/Plugin.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Resources/Public/Plugin.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Resources/Public/Plugin.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Resources/Public/Plugin.js.map

Large diffs are not rendered by default.

0 comments on commit baacaeb

Please sign in to comment.