feat: Optimize SCSS architecture.

This commit is contained in:
a.bouhuolia
2021-01-17 12:17:15 +02:00
parent a747750d88
commit 09db5df686
154 changed files with 2814 additions and 2772 deletions

View File

@@ -0,0 +1,279 @@
@import 'src/style/Base.scss';
.bigcapital-datatable {
display: block;
.dashboard__page-content & {
.table .thead {
.th {
border-bottom-color: #d2dde2;
}
}
}
.table {
text-align: left;
border-spacing: 0;
min-width: 100%;
display: block;
.thead {
overflow-y: auto;
overflow-x: hidden;
.th {
padding: 0.6rem 0.5rem;
background: #fafafa;
font-size: 14px;
color: #58667b;
font-weight: 500;
border-bottom: 1px solid rgb(224, 224, 224);
}
.sort-icon {
width: 0;
height: 0;
position: relative;
top: -2px;
display: inline-block;
margin-left: 5px;
&--desc {
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-bottom: 6px solid #666;
}
&--asc {
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 6px solid #666;
}
}
}
.tr {
display: flex;
flex: 1 0 auto;
&:last-child {
.td {
border-bottom: 0;
}
}
}
.th,
.td {
box-sizing: border-box;
flex: 0 0 auto;
justify-content: flex-start;
align-items: flex-start;
display: flex;
margin: 0;
padding: 0.5rem;
&:last-child {
border-right: 0;
}
.bp3-control {
margin-bottom: 0;
}
.resizer {
display: inline-block;
background: transparent;
width: 10px;
height: 100%;
position: absolute;
right: 0;
top: 0;
transform: translateX(50%);
z-index: 1;
touch-action: none;
&.isResizing {
// background: red;
}
.inner-resizer {
height: 100%;
width: 1px;
border-left: 1px solid #ececec;
margin: 0 auto;
}
&.isResizing .inner-resizer {
background: #1183da;
}
}
.bp3-control.bp3-checkbox .bp3-control-indicator {
border: 2px solid #d7d7d7;
&,
&:hover {
height: 16px;
width: 16px;
}
}
.bp3-control.bp3-checkbox {
input:checked ~ .bp3-control-indicator,
input:indeterminate ~ .bp3-control-indicator {
border-color: #0052ff;
}
}
}
.tbody {
width: 100%;
overflow: auto;
.tbody-inner {
> .loading {
padding-top: 40px;
}
}
.tr .td {
border-bottom: 1px solid #e8e8e8;
align-items: center;
color: #141720;
.placeholder {
color: #a0a0a0;
}
.bp3-form-group {
width: 100%;
}
}
.tr:hover .td {
background: #f3f7fc;
}
.tr.is-context-menu-active .td {
background: #f3fafc;
}
.td.actions .#{$ns}-button {
background: #e6effb;
border: 0;
box-shadow: none;
padding: 5px 15px;
border-radius: 8px;
&:hover,
&:focus {
background-color: #cfdcee;
}
svg {
color: #425361;
}
.bp3-icon-more-h-16 {
margin-top: 2px;
}
}
.tr.no-results {
.td {
flex-direction: column;
padding: 20px;
color: #666;
align-items: center;
}
}
> .loading {
padding-top: 50px;
}
}
.tr .th,
.tr .td {
.expand-toggle {
cursor: pointer;
display: inline-block;
padding: 0 8px 0 0;
padding-left: 0;
margin: auto 0;
margin-left: 4px;
.arrow-right {
width: 0;
height: 0;
border-top: 5px solid transparent;
border-bottom: 5px solid transparent;
border-left: 8px solid #acacac;
display: block;
}
.arrow-down {
width: 0;
height: 0;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 8px solid #acacac;
display: block;
}
}
}
}
.no-results {
color: #666;
.td {
padding-top: 20px;
padding-bottom: 20px;
width: 100%;
}
}
&.has-sticky-header {
.thead {
.tr .th {
position: sticky;
}
}
}
&.has-sticky {
.thead,
.tfoot {
position: sticky;
z-index: 1;
}
.thead {
top: 0;
// box-shadow: 0px 3px 3px #ccc;
}
.tfoot {
bottom: 0;
// box-shadow: 0px -3px 3px #ccc;
}
.tbody {
position: relative;
z-index: 0;
}
[data-sticky-td] {
position: sticky;
}
[data-sticky-last-left-td] {
// box-shadow: 2px 0px 3px #ccc;
}
[data-sticky-first-right-td] {
// box-shadow: -2px 0px 3px #ccc;
}
}
&.has-virtualized-rows {
.tbody {
overflow-y: scroll;
overflow-x: hidden;
}
}
}

View File

@@ -0,0 +1,207 @@
.datatable-editor {
.bp3-form-group {
margin-bottom: 0;
}
.table {
border: 1px solid #d2dce2;
border-left: transparent;
.th,
.td {
border-left: 1px solid #e2e2e2;
&.index {
text-align: center;
span {
width: 100%;
font-weight: 500;
}
}
&:first-child {
border-left: 1px solid #d2dce2;
}
}
.thead {
.tr .th {
padding: 10px 10px;
background-color: #f0f2f8;
font-size: 14px;
font-weight: 500;
color: #1c1940;
&.index > div {
width: 100%;
}
}
}
.tbody {
.tr .td {
padding: 5px;
border-bottom: 0;
border-top: 1px dashed #aaa;
min-height: 42px;
&.index {
background-color: #f0f2f8;
> span {
margin-top: auto;
margin-bottom: auto;
}
}
}
.tr {
.bp3-form-group:not(.bp3-intent-danger) .bp3-input,
.form-group--select-list .bp3-button {
border-color: #ffffff;
color: #222;
border-radius: 3px;
}
.bp3-form-group:not(.bp3-intent-danger) .bp3-input {
border-radius: 2px;
padding-left: 4px;
padding-right: 4px;
&:focus {
box-shadow: 0 0 0 2px #116cd0;
}
}
.form-group--select-list .bp3-button {
padding-left: 6px;
padding-right: 6px;
&:after {
display: none;
}
}
.form-group--select-list,
.bp3-form-group {
&.bp3-intent-danger {
.bp3-button:not(.bp3-minimal),
.bp3-input {
border-color: #f7b6b6;
}
}
}
&:first-of-type {
.td {
border-top: 0;
}
}
&:last-of-type {
.td {
.bp3-button,
.bp3-input-group {
display: none;
}
}
}
.td.actions {
.bp3-button {
background-color: transparent;
color: #e66d6d;
&:hover {
color: #c23030;
}
svg {
color: inherit;
}
}
}
&.row--total {
.account.td,
.debit.td,
.credit.td {
> span {
padding-top: 2px;
}
}
.debit.td,
.credit.td {
> span {
font-weight: 600;
color: #444;
}
}
}
.td {
&.note {
.bp3-form-group {
width: 100%;
}
}
}
}
}
.th {
color: #444;
font-weight: 600;
border-bottom: 1px dotted #666;
}
.td {
border-bottom: 1px dotted #999;
}
.actions.td {
.bp3-button {
background: transparent;
margin: 0;
}
}
}
.table {
.tbody {
.tr .td.actions .bp3-button {
background-color: transparent;
color: #e66d6d;
svg {
color: inherit;
}
}
}
}
&__actions {
margin-top: 12px;
.bp3-button {
padding-left: 10px;
padding-right: 10px;
}
.button--clear-lines {
&.bp3-button:not([class*='bp3-intent-']):not(.bp3-minimal) {
background-color: #fcefef;
}
}
}
&.has-total-row {
.table .tbody-inner .tr:last-of-type {
.td {
border-top-width: 2px;
border-top-color: #e9e9ef;
border-top-style: solid;
min-height: 40px;
&:not(.index) {
background-color: #fcfcfd;
}
&.index span {
display: none;
}
}
}
}
}

View File

@@ -0,0 +1,35 @@
.datatable-empty-status {
max-width: 550px;
width: 100%;
margin: 0 auto;
text-align: center;
margin-top: 200px;
&__title {
font-size: 20px;
color: #2c3a5d;
font-weight: 600;
margin-left: auto;
margin-bottom: 10px;
margin-right: auto;
margin-top: 0;
line-height: 1.4;
}
&__desc {
font-size: 16px;
color: #1f3255;
opacity: 0.8;
line-height: 1.6;
}
&__actions {
margin-top: 26px;
.bp3-button {
min-height: 36px;
& + .bp3-button {
margin-left: 10px;
}
}
}
}

View File

@@ -0,0 +1,109 @@
.pagination{
display: flex;
padding: 25px 14px;
font-size: 13px;
.bp3-button{
background: transparent;
padding: 4px 4px;
}
&__item{
min-width: 24px;
min-height: 24px;
&:not([class*="bp3-intent-"]){
color: #666666;
border-radius: 3px;
&:hover{
background-color: #E6EFFB;
}
}
.bp3-icon{
margin-right: 4px;
color: #666666;
}
.pagination .pagination__buttons-group .bp3-button-group &{
border-radius: 3px;
}
&--next,
&--previous{
&.bp3-button{
padding-left: 6px;
padding-right: 6px;
}
}
&.is-active{
&.bp3-intent-primary:disabled,
&.bp3-intent-primary.bp3-disabled{
background-color: #E6EFFB;
}
&:not([class*="bp3-intent-"]) {
}
.bp3-button-text{
color: #000;
}
}
&--next{
.bp3-icon{
order: 1;
margin-right: 0;
margin-left: 4px;
}
}
}
&__info{
padding-top: 6px;
color: #999;
margin-left: 12px;
}
&__controls{
display: flex;
margin-left: auto;
.bp3-html-select{
margin-left: 6px;
select{
height: 20px;
width: auto;
padding: 0;
padding-right: 0px;
border: 1px solid #e8e8e8;
font-size: 13px;
border-radius: 3px;
color: #666;
padding-right: 14px;
padding-left: 8px;
}
&::after{
border-left-width: 3px;
border-right-width: 3px;
border-top-width: 4px;
margin-right: 6px;
}
}
}
&__goto-control{
display: none;
}
&__pagesize-control{
margin-left: 12px;
padding-top: 4px;
color: #777;
}
}