<commit_before>import { css } from 'styled-components';

import { normalizeColor } from './colors';
import { breakpointStyle, parseMetricToNum } from './mixins';

export const baseStyle = css`
  font-family: ${props => props.theme.global.font.family};
  font-size: ${props => props.theme.global.font.size};
  line-height: ${props => props.theme.global.font.height};
  font-weight: ${props => props.theme.global.font.weight};
  ${props =>
    !props.plain &&
    props.theme.global.colors.background &&
    css`
      background: ${normalizeColor('background', props.theme, true)};
      color: ${normalizeColor('text', props.theme, true)};
    `} box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
`;

export const controlBorderStyle = css`
  border: ${props => props.theme.global.control.border.width} solid
    ${props => normalizeColor('border', props.theme)};
  border-radius: ${props => props.theme.global.control.border.radius};
`;

export const edgeStyle = (
  kind,
  data,
  responsive,
  responsiveBreakpoint,
  theme,
) => {
  const breakpoint =
    responsiveBreakpoint && theme.global.breakpoints[responsiveBreakpoint];

  if (typeof data === 'string') {
    return css`
      ${kind}: ${theme.global.edgeSize[data] || data};
      ${responsive && breakpoint
        ? breakpointStyle(
            breakpoint,
            `
        ${kind}: ${breakpoint.edgeSize[data] || data};
      `,
          )
        : ''};
    `;
  }
  const result = [];
  if (data.horizontal) {
    result.push(css`<commit_msg>adding control to input style (#2922)<commit_after>import { css } from 'styled-components';

import { normalizeColor } from './colors';
import { breakpointStyle, parseMetricToNum } from './mixins';

export const baseStyle = css`
  font-family: ${props => props.theme.global.font.family};
  font-size: ${props => props.theme.global.font.size};
  line-height: ${props => props.theme.global.font.height};
  font-weight: ${props => props.theme.global.font.weight};
  ${props =>
    !props.plain &&
    props.theme.global.colors.background &&
    css`
      background: ${normalizeColor('background', props.theme, true)};
      color: ${normalizeColor('text', props.theme, true)};
    `} box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
`;

export const controlBorderStyle = css`
  border: ${props => props.theme.global.control.border.width} solid
    ${props =>
      normalizeColor(
        props.theme.global.control.border.color || 'border',
        props.theme,
      )};
  border-radius: ${props => props.theme.global.control.border.radius};
`;

export const edgeStyle = (
  kind,
  data,
  responsive,
  responsiveBreakpoint,
  theme,
) => {
  const breakpoint =
    responsiveBreakpoint && theme.global.breakpoints[responsiveBreakpoint];

  if (typeof data === 'string') {
    return css`
      ${kind}: ${theme.global.edgeSize[data] || data};
      ${responsive && breakpoint
        ? breakpointStyle(
            breakpoint,
            `
        ${kind}: ${breakpoint.edgeSize[data] || data};
      `,
          )
        : ''};
    `;
  }
  const result = [];
  if (data.horizontal) {
    result.push(css`
{'fraction_non_alphanumeric': 0.16458333333333333, 'fraction_numerical': 0.004761904761904762, 'mean_word_length': 3.1855541718555416, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4589169', 'n_tokens_mistral': 1094, 'n_tokens_neox': 1050, 'n_words': 202}