Skip to content

Instantly share code, notes, and snippets.

View angelikatyborska's full-sized avatar

Angelika Tyborska angelikatyborska

View GitHub Profile
@angelikatyborska
angelikatyborska / index.ts
Last active February 16, 2023 16:20
TypeScript tasks
// Task 1:
// copy-paste start ----------------------------------------
// TODO: define function argument type
function addOne(numberOrNumbers) {
if (typeof numberOrNumbers === 'number') {
return numberOrNumbers + 1
} else {
@angelikatyborska
angelikatyborska / index.ts
Created March 24, 2023 09:52
TipTap recipes
// Copy the HTML of the current selection
import { getHTMLFromFragment } from "@tiptap/core";
import { Fragment, Node } from "prosemirror-model";
getHTMLFromFragment(
editor.view.state.selection.content().content,
editor.schema
)
// Copy the text of the current selection
@mixin sr_only() {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0,0,0,0);
border: 0;
text-transform: unset;
@mixin button_reset {
background: none;
border: 0;
border-radius: 0;
-webkit-appearance: none;
padding: 0;
text-align: inherit;
color: inherit;
&:active {