refactor(thumbnail): make it mode less

This commit is contained in:
Manu Mtz.-Almeida
2018-08-26 01:35:42 +02:00
parent 7917ba96ef
commit 771857b1df
7 changed files with 4 additions and 68 deletions

View File

@ -1,7 +1,6 @@
import { Component, Element, Event, EventEmitter, Method, Prop, Watch } from '@stencil/core'; import { Component, Element, Event, EventEmitter, Method, Prop, Watch } from '@stencil/core';
import { Mode } from '../../interface.js'; import { Mode } from '../../interface.js';
import { createThemedClasses } from '../../utils/theme.js';
import { Swiper } from './vendor/swiper.js'; import { Swiper } from './vendor/swiper.js';
@ -15,6 +14,7 @@ import { Swiper } from './vendor/swiper.js';
shadow: true shadow: true
}) })
export class Slides { export class Slides {
private container!: HTMLElement; private container!: HTMLElement;
private swiper: any; private swiper: any;
@ -391,12 +391,6 @@ export class Slides {
return { ...swiperOptions, ...this.options, ...eventOptions }; return { ...swiperOptions, ...this.options, ...eventOptions };
} }
hostData() {
return {
class: createThemedClasses(this.mode, 'slides')
};
}
render() { render() {
return ( return (
<div class="swiper-container" ref={el => this.container = el as HTMLElement }> <div class="swiper-container" ref={el => this.container = el as HTMLElement }>

View File

@ -1,10 +0,0 @@
@import "./thumbnail";
@import "./thumbnail.ios.vars";
// iOS Thumbnail
// --------------------------------------------------
:host {
--size: #{$thumbnail-ios-width};
--border-radius: #{$thumbnail-ios-border-radius};
}

View File

@ -1,13 +0,0 @@
@import "../../themes/ionic.globals.ios";
// iOS Thumbnail
// --------------------------------------------------
/// @prop - Width of the thumbnail
$thumbnail-ios-width: 48px !default;
/// @prop - Height of the thumbnail
$thumbnail-ios-height: $thumbnail-ios-width !default;
/// @prop - Border radius of the thumbnail
$thumbnail-ios-border-radius: 0 !default;

View File

@ -1,10 +0,0 @@
@import "./thumbnail";
@import "./thumbnail.md.vars";
// Material Design Thumbnail
// --------------------------------------------------
:host {
--size: #{$thumbnail-md-width};
--border-radius: #{$thumbnail-md-border-radius};
}

View File

@ -1,13 +0,0 @@
@import "../../themes/ionic.globals.md";
// Material Design Thumbnail
// --------------------------------------------------
/// @prop - Width of the thumbnail
$thumbnail-md-width: 48px !default;
/// @prop - Height of the thumbnail
$thumbnail-md-height: $thumbnail-md-width !default;
/// @prop - Border radius of the thumbnail
$thumbnail-md-border-radius: 0 !default;

View File

@ -9,6 +9,8 @@
* @prop --border-radius: Border radius of the thumbnail * @prop --border-radius: Border radius of the thumbnail
* @prop --size: Size of the thumbnail * @prop --size: Size of the thumbnail
*/ */
--size: 48px;
--border-radius: 0;
@include border-radius(var(--border-radius)); @include border-radius(var(--border-radius));

View File

@ -1,25 +1,11 @@
import { Component } from '@stencil/core'; import { Component } from '@stencil/core';
import { Mode } from '../../interface';
import { createThemedClasses } from '../../utils/theme';
@Component({ @Component({
tag: 'ion-thumbnail', tag: 'ion-thumbnail',
styleUrls: { styleUrl: 'thumbnail.scss',
ios: 'thumbnail.ios.scss',
md: 'thumbnail.md.scss'
},
shadow: true shadow: true
}) })
export class Thumbnail { export class Thumbnail {
mode!: Mode;
hostData() {
return {
class: createThemedClasses(this.mode, 'thumbnail')
};
}
render() { render() {
return <slot></slot>; return <slot></slot>;
} }