How to use the @vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js.ThemableMixin function in @vaadin/vaadin-themable-mixin

To help you get started, we’ve selected a few @vaadin/vaadin-themable-mixin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vaadin / flow / flow-tests / test-embedding / test-embedding-generic / frontend / src / themed-component.js View on Github external
* use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

import {PolymerElement, html} from '@polymer/polymer/polymer-element.js';
import {ThemableMixin} from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

class ThemedComponent extends ThemableMixin(PolymerElement) {
  static get template() {
    return html`
        <div>Just a div</div>
    `;
  }

  static get is() { return 'themed-component' }
}

customElements.define(ThemedComponent.is, ThemedComponent);
github FlowingCode / AppLayoutAddon / src / main / resources / META-INF / frontend / fc-applayout / paper-divider.js View on Github external
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

import {PolymerElement} from '@polymer/polymer/polymer-element.js';
import {html} from '@polymer/polymer/lib/utils/html-tag.js';

import {ThemableMixin} from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

//Based on https://github.com/WebPaperElements/paper-divider
class PaperDivider extends ThemableMixin(PolymerElement) {
	static get is() { return 'paper-divider'; }
	
	static get template() {

		return html`
		<style>
			:host {
		        display: block;
		        height: 1px;
		        min-height: 1px;
		        max-height: 1px;
		        background-color: var(--paper-divider-color, #000);
		        opacity: 0.12;
		        @apply(--paper-divider);
			}
		</style>
github FlowingCode / AppLayoutAddon / src / main / resources / META-INF / frontend / fc-applayout / fc-menuitem.js View on Github external
* 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
import {PolymerElement} from '@polymer/polymer/polymer-element.js';
import {html} from '@polymer/polymer/lib/utils/html-tag.js';

import {ThemableMixin} from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
import "@polymer/paper-item/paper-icon-item.js";
import "@vaadin/flow-frontend/iron-collapse-button/iron-collapse-button.js";	

class MenuItem extends ThemableMixin(PolymerElement) {
	static get is() { return 'fc-menuitem'; }
	
	static get template() {
		return html`
		<style>
			:host {
				cursor: pointer;
				display: block;
				--paper-item-disabled-color: var(--lumo-disabled-text-color);
			}
			:host(.iron-selected) #item {
				font-weight: var(--paper-item-selected-weight, bold);
			}
			:host #item {
				width: 100%;
				display: flex;</style>
github FlowingCode / AppLayoutAddon / src / main / resources / META-INF / frontend / fc-applayout / fc-separator.js View on Github external
* 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */
import {PolymerElement} from '@polymer/polymer/polymer-element.js';
import {html} from '@polymer/polymer/lib/utils/html-tag.js';

import {ThemableMixin} from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

import "@vaadin/flow-frontend/fc-applayout/paper-divider.js";

class MenuSeparator extends ThemableMixin(PolymerElement) {
	static get is() { return 'fc-separator'; }
	
	static get template() {

		return html`
		<style>
			:host ::slotted(*) {
				font-size: 80%;
    			padding-left: 8px;
			}
		</style>		
		
		<div></div>
	`;}

}

@vaadin/vaadin-themable-mixin

vaadin-themable-mixin

Apache-2.0
Latest version published 9 days ago

Package Health Score

92 / 100
Full package analysis