Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(aggrid): Improve styling for indeterminate checkbox to be displayed in AG Grid header #1755

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/old-balloons-bow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@siemens/ix-aggrid': patch
---

improve styling of aggrid for indeterminate checkbox to be displayed in grid header
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
improve styling of aggrid for indeterminate checkbox to be displayed in grid header
__AG Grid__: Improve styling of indeterminate checkbox to be displayed in grid header.

40 changes: 28 additions & 12 deletions packages/aggrid/scss/ix-aggrid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
width: 1.125rem;
height: 1.125rem;

&:not(.ag-checked) {
&:not(.ag-checked):not(.ag-indeterminate) {
border: var(--theme-checkbox--border-thickness) solid var(--theme-checkbox-unchecked--border-color);
}

Expand All @@ -60,19 +60,40 @@
mask-repeat: no-repeat;
mask-position: center;
mask-size: contain;
}
&:hover:not(:disabled)::before {
background-color: var(--theme-checkbox-checked--background--hover);
border-color: var(--theme-checkbox-checked--border-color--hover);
}
}

&:hover:not(:disabled) {
background-color: var(--theme-checkbox-checked--background--hover);
border-color: var(--theme-checkbox-checked--border-color--hover);
}
&.ag-indeterminate {
position: relative;

&::before {
content: '';
position: absolute;
inset: 0;
background-color: var(--theme-checkbox-checked--background);
//TODO: Replace base64 encoded image with svg and css variables
//Encoded image: <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="7" width="12" height="2" fill="#000028"/></svg>
Comment on lines +78 to +79
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove the comments here. If you want to still have the todo create a jira ticket for that otherwise we will forget to remove this.

mask-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0id2hpdGUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHJlY3Qgd2lkdGg9IjE4IiBoZWlnaHQ9IjE4IiAvPjwvc3ZnPg=='),
url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIyIiB5PSI3IiB3aWR0aD0iMTIiIGhlaWdodD0iMiIgZmlsbD0iIzAwMDAyOCIvPjwvc3ZnPg==');
mask-composite: subtract;
mask-repeat: no-repeat;
mask-position: center;
mask-size: contain;
}
&:hover:not(:disabled)::before {
background-color: var(--theme-checkbox-checked--background--hover);
border-color: var(--theme-checkbox-checked--border-color--hover);
}
}

&:not(.ag-checked):hover:not(:disabled) {
&:not(.ag-checked, .ag-indeterminate):hover:not(:disabled) {
background-color: var(--theme-checkbox-unchecked--background--hover);
border-color: var(--theme-checkbox-unchecked--border-color--hover);
}

}

.ag-checkbox-input {
Expand All @@ -82,11 +103,6 @@
appearance: none;
-webkit-appearance: none;
border-radius: 4px;

&:focus {
box-shadow: 0 0 3px 3px yellow;
outline: none;
}
}

.ag-input-wrapper {
Expand Down
Loading