json-joy
Version:
Collection of libraries for building collaborative editing apps.
35 lines • 958 B
JavaScript
import * as React from 'react';
import { rule } from 'nano-theme';
const col = '#05f';
const blockClass = rule({
col,
td: 'underline',
textDecorationColor: col,
textDecorationThickness: '1px',
textDecorationStyle: 'wavy',
textUnderlineOffset: '.25em',
// textDecorationSkipInk: 'all',
'&:hover': {
col: col,
},
pd: 0,
mr: 0,
// Needed temporarily, to reset nano-theme styles
bdb: 'none',
'p &': {
bdb: 'none',
'&:hover': {
bdb: 'none',
},
},
});
export const Link = (props) => {
const { children, layers = 1, stack } = props;
const style = layers < 2
? void 0
: {
textDecorationThickness: Math.max(Math.min(0.5 + layers * 0.5, 3), 1) + 'px',
};
return (React.createElement("span", { className: blockClass, style: style, title: stack[0].slice.data()?.title }, children));
};
//# sourceMappingURL=Link.js.map