Skip to content

Instantly share code, notes, and snippets.

View oscarmarina's full-sized avatar

Oscar Marina oscarmarina

  • BBVA
  • Madrid, Spain
View GitHub Profile
@oscarmarina
oscarmarina / index.html
Created April 23, 2023 17:44 — forked from e111077/index.html
MWC Select working inside an MWC dialog
<!DOCTYPE html>
<head>
<script type="module" src="./simple-greeting.js"></script>
</head>
<body>
<simple-greeting name="World"></simple-greeting>
</body>
import type {ReactiveController, ReactiveControllerHost} from 'lit';
/**
* A reactive controller that updates a host when slotted content changes and
* provides helper methods for checking and getting assigned slot content.
*/
export class SlotController implements ReactiveController {
private _host: ReactiveControllerHost & Element;
private _slotNames?: ReadonlyArray<string>;
@oscarmarina
oscarmarina / index.html
Created May 16, 2020 05:31 — forked from ebidel/index.html
<responsive-element> custom element for enabling container/element queries
<!-- based on https://twitter.com/ebidel/status/933496242272747520 -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title><responsive-element></title>
<link rel="stylesheet" href="styles.css">
</head>
@oscarmarina
oscarmarina / findall_elements_deep.js
Created May 16, 2020 05:30 — forked from ebidel/findall_elements_deep.js
Finds all elements on the page, including those within shadow dom.
/**
* @author ebidel@ (Eric Bidelman)
* License Apache-2.0
*/
/**
* Finds all elements on the page, inclusive of those within shadow roots.
* @param {string=} selector Simple selector to filter the elements by. e.g. 'a', 'div.main'
* @return {!Array<string>} List of anchor hrefs.
*/