import { css } from '@tesseract-design/css-utils';

export type BadgeBaseArgs = {
  rounded: boolean,
}

export const Root = ({
  rounded,
}: BadgeBaseArgs) => css.cx(
  css`
    position: relative;
    height: 1.5em;
    min-width: 1.5em;
    display: inline-grid;
    vertical-align: middle;
    place-content: center;
    overflow: hidden;
    font-stretch: var(--font-stretch-base, normal);
    padding: 0 0.25rem;
    box-sizing: border-box;
    &::before {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: currentColor;
      opacity: 0.25;
      content: '';
    }
  `,
  css.dynamic({
    'border-radius': rounded ? '0.75em' : '0.25rem',
  }),
);

export const Content = () => css.cx(
  css`
    position: relative;
    font-size: 0.75em;
  `
);
