Added custom theme

This commit is contained in:
MaxOvs19
2023-02-14 20:19:57 +03:00
parent 4a2e8c9b17
commit fd8fc093d0
8 changed files with 69 additions and 32 deletions

View File

@ -5,6 +5,10 @@
font-family: Arial, Helvetica, sans-serif;
}
.testClassRed {
background-color: #ff8282;
}
.body-example {
background: #000000c4;
}

View File

@ -1,5 +1,6 @@
import { CGSelect } from '../src/cg-select';
import './example';
import { newCustomTheme } from './themeTest';
// ------------------------------Обычный селект--------------------
const dropdown = new CGSelect({
@ -25,11 +26,12 @@ const dropdown = new CGSelect({
width: '824px',
},
},
theme: newCustomTheme,
});
dropdown.on('clear', function (e) {
console.log(`this state: ${e}`);
});
// dropdown.on('clear', function (e) {
// console.log(`this state: ${e}`);
// });
// ------------------------------NativeSelect-----------------------
const dropdownNativeSelect = new CGSelect({

9
example/themeTest.ts Normal file
View File

@ -0,0 +1,9 @@
import { CustomTheme } from 'components/theme/theme.interface';
export const newCustomTheme: CustomTheme = {
name: 'test',
styles: {
head: 'testClassRed',
list: 'testClassRed',
},
};