diff --git a/example/example.js b/example/example.js index f807677..2238b38 100644 --- a/example/example.js +++ b/example/example.js @@ -13,38 +13,36 @@ const codeFourth = document.getElementById('codeFourth'); const fifthBtn = document.getElementById('fifth'); const codeFifth = document.getElementById('codeFifth'); -const six = document.getElementById('six') +const six = document.getElementById('six'); const codeSix = document.getElementById('codeSix'); - -const Native = document.getElementById('Native') -const codeNative = document.getElementById('codeNative') - +const Native = document.getElementById('Native'); +const codeNative = document.getElementById('codeNative'); firstBtn.addEventListener('click', () => { - codeFirst.classList.toggle("active") -}) + codeFirst.classList.toggle('active'); +}); secondBtn.addEventListener('click', () => { - codeSecond.classList.toggle("active") -}) + codeSecond.classList.toggle('active'); +}); thirdBtn.addEventListener('click', () => { - codeThird.classList.toggle("active") -}) + codeThird.classList.toggle('active'); +}); fourthBtn.addEventListener('click', () => { - codeFourth.classList.toggle("active") -}) + codeFourth.classList.toggle('active'); +}); fifthBtn.addEventListener('click', () => { - codeFifth.classList.toggle("active") -}) + codeFifth.classList.toggle('active'); +}); six.addEventListener('click', () => { - codeSix.classList.toggle("active") -}) + codeSix.classList.toggle('active'); +}); Native.addEventListener('click', () => { - codeNative.classList.toggle("active") -}) \ No newline at end of file + codeNative.classList.toggle('active'); +}); diff --git a/example/example.scss b/example/example.scss index 8255b19..1a9c973 100644 --- a/example/example.scss +++ b/example/example.scss @@ -3,10 +3,12 @@ * { font-size: 14px; font-family: Arial, Helvetica, sans-serif; + text-align: justify; } -.testClassRed { +.testClass { background-color: #ff8282; + color: white; } .body-example { @@ -144,6 +146,39 @@ } } +.row { + display: flex; + justify-content: space-around; +} + +.description-theme { + color: white; + .col { + width: 54%; + } + + img { + border-radius: 15px; + } + + .createTheme { + display: flex; + flex-direction: column; + } + + h5 { + font-size: 18px; + margin: 0; + } + h6 { + font-size: 17px; + margin: 0; + } + p { + font-size: 16px; + } +} + code { display: none; } diff --git a/example/index.html b/example/index.html index b316ee7..b66e1ad 100644 --- a/example/index.html +++ b/example/index.html @@ -192,6 +192,115 @@ +
+ To change the theme of the select, you need to specify this parameter in the select + settings. The default theme is the classic theme, you can choose a white or dark + theme. +
+
+
+ const dropdown = new CGSelect({
+ selector: '.cg-dropdown_one',
+ placeholder: 'Choose a car',
+ lable: 'EXAMPLE',
+ items: [
+ ...
+ ],
+ theme: 'dark / white'
+ });
+
+
+ + To create your own theme, you need to create an object with the following fields. + In these fields you need to insert the previously created css class. After + creating the object, just pass it to the select settings. +
+
+
+ interface CustomTheme {
+ name: 'string',
+ styles: {
+ head?: 'string',
+ list?: 'testClass', ,
+ placeholder?: 'string', ,
+ caret?: 'string', ,
+ search?: 'string', ,
+ chips?: 'string', ,
+ lable?: 'string', ,
+ },
+ });
+
+
+
+
+ const newTheme = {
+ name: 'test',
+ styles: {
+ head: 'testClass',
+ list: 'testClass', ,
+ placeholder: 'testClass', ,
+ caret: 'testClass', ,
+ search: 'testClass', ,
+ chips: 'testClass', ,
+ lable: 'testClass', ,
+ },
+ });
+
+
+
+
+
+ const newCustomTheme: CustomTheme = {
+ name: 'test',
+ styles: {
+ head: 'testClass',
+ list: 'testClass', ,
+ placeholder: 'testClass', ,
+ caret: 'testClass', ,
+ search: 'testClass', ,
+ chips: 'testClass', ,
+ lable: 'testClass', ,
+ },
+ });
+
+
+
+
+ .testClass {
+ background-color: #ff8282;
+ color: white;
+ }
+
+
+