How to use the @edtr-io/ui.styled.span function in @edtr-io/ui

To help you get started, we’ve selected a few @edtr-io/ui 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 edtr-io / edtr-io / packages / plugins / text / src / plugins / katex / editor.tsx View on Github external
overflowWrap: undefined,
    ...(props.inline
      ? {
          display: 'inline-block'
        }
      : {
          display: 'flex',
          flexDirection: 'column',
          alignItems: 'center',
          marginTop: '0.9em',
          marginBottom: '0.9em'
        })
  }
})

const KeySpan = styled.span({
  background: '#ddd',
  padding: '2px 4px',
  borderRadius: 5,
  color: '#1d1c1d',
  textAlign: 'center',
  minWidth: 20
})

const HelpText = (
  <>
    Tastenkürzel:
    <br>
    <br>
    <p>
      Bruch: /
    </p>
github edtr-io / edtr-io / packages / public / default-plugin-toolbar / src / overlay-input.tsx View on Github external
import { OverlayInputProps } from '@edtr-io/plugin-toolbar'
import { styled } from '@edtr-io/ui'
import * as React from 'react'

import { DefaultPluginToolbarConfig } from './config'

const OverlayInputLabel = styled.label({
  color: 'rgba(51,51,51,0.95)',
  margin: '20px auto 0px',
  display: 'flex',
  justifyContent: 'space-between',
  alignItems: 'center'
})

const OverlayInputLabelInner = styled.span({ width: '20%' })

const OverlayInputInner = styled.input&lt;{ config: DefaultPluginToolbarConfig }&gt;(
  ({ config }) =&gt; {
    return {
      backgroundColor: '#ffffff',
      border: 'none',
      borderBottom: '2px solid rgba(51,51,51,0.95)',
      color: 'rgba(51,51,51,0.95)',
      width: '75%',
      '&amp;:focus': {
        outline: 'none',
        borderBottom: `2px solid ${config.primaryColor}`
      }
    }
  }
)
github edtr-io / edtr-io / packages / ui-editor / src / components / settings-overlay.tsx View on Github external
const theme = createOverlayTheme(props.theme)
  return {
    boxShadow: '0 2px 4px 0 rgba(0,0,0,0.50)',
    backgroundColor: theme.backgroundColor,
    color: theme.color,
    borderRadius: '4px',
    '& a': {
      color: theme.color,
      '&:hover': {
        color: theme.highlightColor
      }
    }
  }
})

const InlinePreview = styled.span({
  padding: '0px 8px'
})
const ChangeButton = styled.div((props: EditorThemeProps) => {
  const theme = createOverlayTheme(props.theme)

  return {
    padding: '5px 5px 5px 10px',
    display: 'inline-block',
    borderLeft: `2px solid ${theme.color}`,
    cursor: 'pointer',
    margin: '2px',
    '&:hover': {
      color: theme.highlightColor
    }
  }
})
github edtr-io / edtr-io / packages / ui-editor / src / components / overlay-textarea.tsx View on Github external
}
  }
)
const TextareaLabel = styled.label(props =&gt; {
  const theme = createOverlayTheme(props.theme)

  return {
    color: theme.textarea.color,
    display: 'flex',
    flexDirection: 'row',
    margin: '20px auto 0',
    justifyContent: 'space-between'
  }
})

const TextareaLabelInner = styled.span({ width: '20%' })

const TextareaInner = styled.textarea(props =&gt; {
  const theme = createOverlayTheme(props.theme)

  return {
    backgroundColor: theme.textarea.backgroundColor,
    border: `2px solid ${theme.textarea.borderColor}`,
    marginTop: '5px',
    borderRadius: '5px',
    color: theme.textarea.color,
    padding: '10px',
    resize: 'none',
    outline: 'none',
    minHeight: '100px',
    width: '75%',
    '&amp;:focus': {
github edtr-io / edtr-io / packages / ui-editor / src / components / editor-checkbox.tsx View on Github external
const CheckboxToggleContainer = styled.div((props: EditorThemeProps) =&gt; {
  const theme = createEditorCheckboxTheme('checkbox', props.theme)

  return {
    cursor: 'pointer',
    margin: '0 5px -1px 5px',
    border: `2px solid ${theme.color}`,
    borderRadius: '15%',
    width: '15px',
    height: '15px',
    display: 'inline-block',
    backgroundColor: theme.boxDeselectedColor
  }
})

const CheckboxLabelInner = styled.span({ width: '5%' })

const CheckboxToggle = styled.div&lt;{ value?: boolean }&gt;(
  ({ value, ...props }: { value?: boolean } &amp; EditorThemeProps) =&gt; {
    const theme = createEditorCheckboxTheme('checkbox', props.theme)

    return {
      opacity: value ? 1 : 0,
      content: '',
      position: 'absolute',
      fontWeight: 'bold',
      margin: '3px 0 0 2px',
      width: '10px',
      height: '5px',
      border: `2px solid ${theme.boxSelectedColor}`,
      borderTop: 'none',
      borderRight: 'none',
github edtr-io / edtr-io / packages / plugins / text / src / plugins / suggestions.tsx View on Github external
backgroundColor: active
        ? theme.suggestions.background.highlight
        : theme.suggestions.background.default,
      borderRadius: '4px',
      '&amp;:hover': {
        background: theme.suggestions.background.highlight
      }
    }
  }
)

const Container = styled.div({
  padding: '10px'
})

const StyledText = styled.span&lt;{ highlight: boolean; config: TextConfig }&gt;(
  ({ highlight, config }) =&gt; {
    const { theme } = config
    return {
      color: highlight
        ? theme.suggestions.text.highlight
        : theme.suggestions.text.default
    }
  }
)

export class Suggestions extends React.Component {
  public render() {
    return (
      
        {this.props.options.length === 0
          ? 'keine Einträge vorhanden'
github edtr-io / edtr-io / packages / plugins / text / src / controls / colors.tsx View on Github external
)
}

const ColorPaletteIcon = styled.div&lt;{ color: string }&gt;(props =&gt; {
  return {
    display: 'inline-block',
    backgroundColor: props.color,
    borderRadius: ' 100%',
    width: '19px',
    height: '19px',
    margin: '3px',
    verticalAlign: 'middle'
  }
})

const ColoredText = styled.span({
  position: 'relative',
  verticalAlign: 'middle',
  display: 'inline-block'
})

const FlexContainer = styled.span({
  display: 'flex',
  alignItems: 'center',
  flexDirection: 'column'
})

const Line = styled.span&lt;{ index?: number }&gt;(
  (props: ThemeProps &amp; { index?: number }) =&gt; {
    const theme = createTextPluginTheme(name, props.theme)
    const { colors, defaultColor } = theme.plugins.colors
    return {
github edtr-io / edtr-io / packages / ui-editor / src / components / overlay-checkbox.tsx View on Github external
justifyContent: 'space-between',
    marginTop: '20px'
  }
})

const CheckboxInlineLabel = styled.label((props: EditorThemeProps) =&gt; {
  const theme = createOverlayTheme(props.theme)
  return {
    color: theme.checkbox.color,
    verticalAlign: 'middle',
    margin: '5px 10px',
    display: 'inline-block'
  }
})

const CheckboxInlineLabelInner = styled.span({
  marginRight: '10px',
  verticalAlign: 'middle'
})

const CheckboxToggleContainer = styled.div&lt;{
  value?: boolean
}&gt;(({ value, ...props }: { value?: boolean } &amp; EditorThemeProps) =&gt; {
  const theme = createOverlayTheme(props.theme)

  return {
    cursor: 'pointer',
    border: `2px solid ${theme.checkbox.color}`,
    borderRadius: '15%',
    width: '20px',
    height: '20px',
    display: 'inline-block',
github edtr-io / edtr-io / packages / plugins / text / src / controls / colors.tsx View on Github external
backgroundColor: props.color,
    borderRadius: ' 100%',
    width: '19px',
    height: '19px',
    margin: '3px',
    verticalAlign: 'middle'
  }
})

const ColoredText = styled.span({
  position: 'relative',
  verticalAlign: 'middle',
  display: 'inline-block'
})

const FlexContainer = styled.span({
  display: 'flex',
  alignItems: 'center',
  flexDirection: 'column'
})

const Line = styled.span&lt;{ index?: number }&gt;(
  (props: ThemeProps &amp; { index?: number }) =&gt; {
    const theme = createTextPluginTheme(name, props.theme)
    const { colors, defaultColor } = theme.plugins.colors
    return {
      border: `2px solid ${
        props.index === undefined
          ? defaultColor
          : colors[props.index % colors.length]
      }`,
      borderRadius: '4px',
github edtr-io / edtr-io / packages / ui-editor / src / components / overlay-checkbox.tsx View on Github external
return {
    cursor: 'pointer',
    border: `2px solid ${theme.checkbox.color}`,
    borderRadius: '15%',
    width: '20px',
    height: '20px',
    display: 'inline-block',
    verticalAlign: 'middle',
    backgroundColor: value
      ? theme.checkbox.boxSelectedColor
      : theme.checkbox.boxDeselectedColor
  }
})

const CheckboxLabelInner = styled.span({ width: '20%' })

const CheckboxToggle = styled.div&lt;{ value?: boolean }&gt;(
  ({ value, ...props }: { value?: boolean } &amp; EditorThemeProps) =&gt; {
    const theme = createOverlayTheme(props.theme)

    return {
      opacity: value ? 1 : 0,
      content: '',
      position: 'absolute',
      fontWeight: 'bold',
      width: '20px',
      height: '10px',
      border: `3px solid ${theme.checkbox.boxDeselectedColor}`,
      borderTop: 'none',
      borderRight: 'none',
      borderRadius: '1px',