Skip to content

Commit

Permalink
fix(stackblitz): add scss style for datepicker custom class demo exam…
Browse files Browse the repository at this point in the history
…ple (#5300)
  • Loading branch information
ludmilanesvitiy authored and Domainv committed Jun 25, 2019
1 parent 8021169 commit 2d75dc5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DatepickerDateCustomClasses } from 'ngx-bootstrap/datepicker';
@Component({
selector: 'demo-datepicker-date-custom-classes',
templateUrl: './date-custom-classes.html',
styleUrls: ['.//date-custom-classes.scss']
styleUrls: ['./date-custom-classes.scss']
})
export class DemoDatepickerDateCustomClassesComponent {
dateCustomClasses: DatepickerDateCustomClasses[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { main } from './stackblitz/main';
import { polyfills } from './stackblitz/polyfills';
import { getAppModuleCode, NgxModuleData } from './stackblitz/app.module';
import { getIndexHtmlCode } from './stackblitz/html';
import { getComponentClassName, getTagName, getTemplateFileName } from './stackblitz/helpers';
import { getComponentClassName, getTagName, getTemplateFileName, getCSSCodeDatepickerCustomClass } from './stackblitz/helpers';

@Component({
selector: 'examples',
Expand Down Expand Up @@ -101,6 +101,9 @@ export class ExamplesComponent {
description: 'stackblitz demo',
template: 'angular-cli'
};
if (className === 'DemoDatepickerDateCustomClassesComponent') {
project.files['app/date-custom-classes.scss'] = getCSSCodeDatepickerCustomClass();
}
project.files[`app/${templateName}`] = this.getHtml(html);

sdk.openProject(project);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,17 @@ export function getTemplateFileName(code: string): string | null {

return matches.length ? matches[0].substring(matches[0].indexOf('/') + 1, matches[0].lastIndexOf('\'')) : null;
}

export function getCSSCodeDatepickerCustomClass() {
return `::ng-deep .theme-green {
.bs-datepicker-body {
table {
td {
span.selected {
background-color: #5cb85c !important;
}
}
}
}
}`;
}

0 comments on commit 2d75dc5

Please sign in to comment.