Skip to content

Commit

Permalink
New: Add dt-datetime class to input element
Browse files Browse the repository at this point in the history
Dev: Dark mode, add `color-scheme: dark` to input and select elements
when in dark mode

DD-2648
  • Loading branch information
AllanJard committed Jun 19, 2023
1 parent 2197de2 commit 1900f12
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 3 deletions.
8 changes: 8 additions & 0 deletions css/dataTables.dateTime.scss
Expand Up @@ -280,6 +280,10 @@ div.dt-datetime-error {


html.dark {
input.dt-datetime {
color-scheme: dark;
}

div.dt-datetime {
border: 1px solid rgb(89, 91, 94);
background-color: rgb(33, 37, 41);
Expand Down Expand Up @@ -351,6 +355,10 @@ html.dark {
border-left-color: white;
}
}

select {
color-scheme: dark;
}
}

div.dt-datetime-error {
Expand Down
6 changes: 6 additions & 0 deletions dist/dataTables.dateTime.css
Expand Up @@ -231,6 +231,9 @@ div.dt-datetime-error {
color: #b11f1f;
}

html.dark input.dt-datetime {
color-scheme: dark;
}
html.dark div.dt-datetime {
border: 1px solid #595b5e;
background-color: #212529;
Expand Down Expand Up @@ -281,6 +284,9 @@ html.dark div.dt-datetime div.dt-datetime-iconLeft:after {
html.dark div.dt-datetime div.dt-datetime-iconRight:after {
border-left-color: white;
}
html.dark div.dt-datetime select {
color-scheme: dark;
}
html.dark div.dt-datetime-error {
color: #b11f1f;
}
2 changes: 2 additions & 0 deletions dist/dataTables.dateTime.js
Expand Up @@ -197,6 +197,8 @@ var DateTime = function ( input, opts ) {
.append( this.dom.buttons )
.append( this.dom.calendar );

this.dom.input.addClass('dt-datetime');

this._constructor();
};

Expand Down
2 changes: 1 addition & 1 deletion dist/dataTables.dateTime.min.css

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

2 changes: 1 addition & 1 deletion dist/dataTables.dateTime.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/dataTables.dateTime.min.mjs

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/dataTables.dateTime.mjs
Expand Up @@ -161,6 +161,8 @@ var DateTime = function ( input, opts ) {
.append( this.dom.buttons )
.append( this.dom.calendar );

this.dom.input.addClass('dt-datetime');

this._constructor();
};

Expand Down
2 changes: 2 additions & 0 deletions js/dataTables.dateTime.js
Expand Up @@ -155,6 +155,8 @@ var DateTime = function ( input, opts ) {
.append( this.dom.buttons )
.append( this.dom.calendar );

this.dom.input.addClass('dt-datetime');

this._constructor();
};

Expand Down

0 comments on commit 1900f12

Please sign in to comment.