Skip to content

Commit

Permalink
Merge pull request #97 from ngx-lib/feature/css-flex
Browse files Browse the repository at this point in the history
CSS with Flex.
  • Loading branch information
pankajparkar authored Jul 30, 2019
2 parents 1b7c5ae + dea5270 commit 118a98a
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 272 deletions.
Original file line number Diff line number Diff line change
@@ -1,65 +1,44 @@
/* Material CSS start */
/* Common */

:host {
width: 100%;
display: block;
.input-search {
display: flex;
flex-grow: 1;
align-items: stretch;
height: 30px;
padding: 2px;
}

/* Material CSS start */

.mat-multiselect :host ::ng-deep .input-search {
width: 100%;
position: relative;
max-height: 35px;
overflow: hidden;
box-sizing: content-box;
border-bottom: 1px solid rgba(0, 0, 0, 0.12);
display: inline-flex;
border-bottom: 1px solid rgba(0,0,0,.12);
}

.mat-multiselect :host ::ng-deep .input-filter {
flex-grow: 1;
font: inherit;
background: 0 0;
color: currentColor;
outline: none;
border: none;
outline: 0;
padding: 0;
margin: 0;
width: 100%;
max-width: 100%;
vertical-align: bottom;
text-align: inherit;
margin-top: -0.0625em;
}

.mat-multiselect :host ::ng-deep .field-infix {
display: block;
position: relative;
padding: 5px 10px;
flex: auto;
min-width: 0;
width: 90%;
position: relative;
padding: 5px;
flex: 1;
display: flex;
}

.mat-multiselect :host ::ng-deep .field-suffix {
width: 20px;
height: 20px;
white-space: nowrap;
flex: none;
position: relative;
top: 5px;
right: 5px;
margin: 3px;
}
.mat-multiselect :host ::ng-deep .field-suffix button {
position: relative;
padding: 0;
border: none;
font-size: 14px;
font-size: inherit;
width: 20px;
height: 20px;
min-width: 20px;
border-radius: 10px;
line-height: 1;
font-weight: 500;
}

/* Material CSS end */
Expand All @@ -70,74 +49,40 @@
padding: 0;
min-width: 20px;
max-width: 20px;
border-radius: 50%;
border: none;
cursor: pointer;
}

.bs-multiselect :host ::ng-deep .input-search {
display: flex;
padding: 2px 0px 4px 0px;
max-height: 30px;
overflow: hidden;
box-sizing: content-box;
cursor: pointer;
border-radius: 2px;
color: #666;
background-color: #f1f1f1;
border: none;
font-size: inherit;
}

.bs-multiselect :host ::ng-deep .input-filter {
border-radius: 2px;
height: 30px;
font-size: 14px;
height: 100%;
width: 100%;
font-size: inherit;
padding-left: 7px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 0px 0px 8px 0px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
cursor: pointer;
border: 1px solid #ccc;
border-radius: 2px;
color: #666;
}

.bs-multiselect :host ::ng-deep .clear-button {
text-align: center;
cursor: pointer;
border: 1px solid #ccc;
border-radius: 2px;
color: #666;
background-color: #f1f1f1;
}

.bs-multiselect :host ::ng-deep .field-infix {
display: flex;
padding: 2px;
flex: 18;
flex-grow: 1;
}

.bs-multiselect :host ::ng-deep .field-suffix {
flex: 2;
display: flex;
align-items: center;
justify-content: center;
}
.bs-multiselect :host ::ng-deep .field-suffix button {
border: none;
padding: 0;
font-size: 20px;
min-width: 25px;
line-height: 1.1;
}

/* Boostrap CSS end */

/* Common */

.mat-multiselect :host ::ng-deep button[disabled],
.mat-multiselect :host ::ng-deep button:disabled,
.bs-multiselect :host ::ng-deep button[disabled],
.bs-multiselect :host ::ng-deep button:disabled {
background: whitesmoke;
color: #dad4d4;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
/>
</div>
<div class="field-suffix">
<button type="button" [disabled]="!filterName.value" (click)="clearInputFilter()" class="clear-button">×</button>
<button type="button" [disabled]="!filterName.value" (click)="clearInputFilter()" class="clear-button">X</button>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,78 +1,52 @@
/* Material CSS start */

.mat-multiselect :host .helper-buttons {
border-bottom: 1px solid #ddd;
padding: 4px;
}

.mat-multiselect :host .helper-button {
display: inline-block;
.helper-button {
font-weight: 400;
color: #444;
text-align: center;
vertical-align: middle;
font-size: .75rem;
max-height: 30px;
white-space: nowrap;
height: 30px;
border-radius: .25rem;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
border: 1px solid rgba(0,0,0,.12);
}

fieldset {
padding: 0;
border: none;
}

.helper-buttons {
border-bottom: 1px solid #ddd;
padding: 2px;
}

/* Material CSS start */

.mat-multiselect :host .helper-button {
background-color: transparent;
border: 1px solid transparent;
padding: 0.13rem 0.13rem;
font-size: 0.75rem;
line-height: 1.5;
border-radius: 0.25rem;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out,
box-shadow 0.15s ease-in-out;
border-color: rgba(0, 0, 0, 0.12);
color: #444;
}

.mat-multiselect :host .helper-button:not(:last-child) {
margin-right: 4px;
margin: 0 2px;
}

/* Material CSS end */

/* Boostrap CSS start */

.bs-multiselect :host .helper-buttons {
border-bottom: 1px solid #ddd;
padding: 4px 4px 4px;
}

.bs-multiselect :host .helper-button {
max-height: 26px;
height: 26px;
border: 1px solid rgba(0, 0, 0, 0.12) !important;
padding: 0px 4px 0px;
box-sizing: border-box;
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
cursor: pointer;
outline: 0;
border: none;
padding: .25em;
-webkit-tap-highlight-color: transparent;
display: inline-block;
white-space: nowrap;
text-decoration: none;
vertical-align: baseline;
text-align: center;
margin: 0;
min-width: 60px;
line-height: 25px;
border-radius: 4px;
overflow: visible;
}

.bs-multiselect .helper-button:not(:last-child) {
margin-right: 4px;
}

/* Boostrap CSS end */

fieldset {
padding: 0;
border: none;
}
Loading

0 comments on commit 118a98a

Please sign in to comment.