Skip to content

Instantly share code, notes, and snippets.

View StefanNieuwenhuis's full-sized avatar
:bowtie:
Follow me on twitter @stefannhs

stefannhs StefanNieuwenhuis

:bowtie:
Follow me on twitter @stefannhs
View GitHub Profile
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Stencil Component Starter</title>
<script src="/build/mycomponent.js"></script>
</head>
import { Component, Prop } from '@stencil/core';
@Component({
tag: 'my-component',
styleUrl: 'my-component.css',
shadow: true
})
export class MyComponent {
@Prop({mutable: true}) isActive = false;
import { Component } from '@stencil/core';
@Component({
tag: 'my-component',
styleUrl: 'my-component.css',
shadow: true
})
export class MyComponent {
@Prop({mutable: true}) isActive = false;
.modal {
display:none;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0, 0.2);
import { newE2EPage } from '@stencil/core/testing';
describe('my-component', () => {
let page, component, element;
beforeEach(async () => {
page = await newE2EPage();
await page.setContent('<my-component></my-component>');
component = await page.find('my-component');
import { Component } from '@stencil/core';
@Component({
tag: 'my-component',
styleUrl: 'my-component.css',
shadow: true
})
export class MyComponent {
render() {
return <div class="overlay">
.overlay {
opacity: 0;
visibility: hidden;
position:fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
<title>Stencil Component Starter</title>
<script src="/build/mycomponent.js"></script>
</head>
import { Component, Prop } from '@stencil/core';
@Component({
tag: 'my-component',
styleUrl: 'my-component.css',
shadow: true
})
export class MyComponent {
@Prop() open = false;
@Prop() transparent = false;
import { newE2EPage } from '@stencil/core/testing';
describe('my-component', () => {
let page, component, element;
beforeEach(async () => {
page = await newE2EPage();
await page.setContent('<my-component></my-component>');
component = await page.find('my-component');