How to use the @commercetools-uikit/design-system.customProperties.colorPrimary function in @commercetools-uikit/design-system

To help you get started, we’ve selected a few @commercetools-uikit/design-system 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 commercetools / ui-kit / src / components / inputs / toggle-input / toggle-input.js View on Github external
height: ${props =>
      props.size === 'small' ? thumbSmallSize : thumbBigSize};
    width: ${props => (props.size === 'small' ? thumbSmallSize : thumbBigSize)};
    background-color: ${vars.colorSurface};
    box-shadow: ${vars.shadow7};
    border-radius: 50%;
    z-index: 1;
    transition: transform 0.2s ease, background 0.2s ease;
  }
`;

const Input = styled.input`
  /* when checked */
  &:checked {
    + ${Span}::before {
      background: ${vars.colorPrimary};
    }
    & + ${Span}::after {
      transform: ${props =>
        props.size === 'small'
          ? 'translate(117%, -50%)'
          : 'translate(127%, -50%)'};
    }
  }

  /* when disabled */
  &:disabled {
    & + ${Span}::before {
      background: ${vars.colorNeutral};
      box-shadow: none;
    }
    & + ${Span}::after {
github commercetools / merchant-center-application-kit / visual-testing-app / src / components / tabular-modal-page / tabular-modal-page.visualroute.tsx View on Github external
} from '@commercetools-uikit/icons';
import { customProperties } from '@commercetools-uikit/design-system';
import Spacings from '@commercetools-uikit/spacings';
import { TabularModalPage } from '@commercetools-frontend/application-components';
import { Suite, Spec } from '../../test-utils';

export const routePath = '/tabular-modal-page';

const TabControlsContainer = styled.div`
  min-height: 30px;
  display: flex;
  > * {
    min-width: 50px;
    cursor: pointer;
    &:first-of-type {
      border-bottom: 3px solid ${customProperties.colorPrimary};
      & > * {
        color: ${customProperties.colorPrimary};
      }
    }
  }
  > * + * {
    margin-left: 16px;
  }
`;

type ContainerProps = {
  portalId: string;
} & Partial[0]>;

const ModalPageWithPortalParentSelector = ({
  portalId,
github commercetools / merchant-center-application-kit / packages / react-notifications / src / components / notification / notification.styles.ts View on Github external
const getColorByType = (value: TAppNotificationKind) => {
  switch (value) {
    case NOTIFICATION_KINDS_SIDE.success:
      return customProperties.colorPrimary;
    case NOTIFICATION_KINDS_SIDE.info:
      return customProperties.colorInfo;
    case NOTIFICATION_KINDS_SIDE.error:
      return customProperties.colorError;
    case NOTIFICATION_KINDS_SIDE.warning:
      return customProperties.colorWarning;
    default:
      return 'transparent';
  }
};
github commercetools / ui-kit / src / components / buttons / icon-button / icon-button.styles.js View on Github external
const getThemeStyles = theme => {
  if (!theme) return css``;

  if (theme === 'default') return css``;

  switch (theme) {
    case 'primary':
      return css`
        &:hover {
          background-color: ${vars.colorPrimary};
          border-color: ${vars.colorPrimary};
          color: ${vars.colorSurface};
        }
      `;
    case 'info':
      return css`
        &:hover {
          background-color: ${vars.colorInfo};
          border-color: ${vars.colorInfo};
          color: ${vars.colorSurface};
        }
      `;
    default: {
      invariant(
        false,
        `ui-kit/IconButton: the specified theme '${theme}' is not supported.`
github commercetools / ui-kit / src / components / buttons / link-button / link-button.js View on Github external
    color: ${props => (props.disabled ? vars.colorNeutral : vars.colorPrimary)};
  }
github commercetools / ui-kit / src / components / internals / calendar-day / calendar-day.js View on Github external
padding: ${vars.spacingS} 0;
      cursor: default;
      color: ${vars.colorNeutral60};
    `);
  }
  if (props.isHighlighted) {
    styles.push(
      css`
        background-color: ${vars.colorNeutral90};
      `
    );
  }
  if (props.isSelected) {
    styles.push(
      css`
        background-color: ${vars.colorPrimary};
        color: ${vars.colorSurface};
      `
    );
  }
  if (props.isRangeStart || props.isRangeEnd) {
    styles.push(
      css`
        background-color: ${vars.colorPrimary40};
        color: ${vars.colorSurface};
      `
    );
  }
  if (props.isRangeBetween) {
    styles.push(
      css`
        background-color: ${vars.colorNeutral90};
github commercetools / ui-kit / src / components / buttons / primary-button / primary-button.styles.js View on Github external
box-shadow: ${vars.shadow7};
      &:hover,
      &:focus {
        box-shadow: ${vars.shadow8};
      }
      &:active {
        box-shadow: ${vars.shadow9};
      }
    `,
  ];
  switch (tone) {
    case 'primary':
      return [
        baseDefaultStyles,
        css`
          background-color: ${vars.colorPrimary};
          &:hover {
            background-color: ${vars.colorPrimary25};
          }
          &:active {
            background-color: ${vars.colorPrimary};
          }
        `,
      ];
    case 'urgent':
      return [
        baseDefaultStyles,
        css`
          background-color: ${vars.colorWarning};
          &:hover {
            background-color: ${vars.colorPrimary25};
          }
github commercetools / ui-kit / src / components / notifications / content-notification / content-notification.js View on Github external
const getIconContainerBackgroundColour = props => {
  switch (props.type) {
    case 'error':
      return vars.colorError;
    case 'info':
      return vars.colorInfo;
    case 'warning':
      return vars.colorWarning;
    case 'success':
      return vars.colorPrimary;
    default:
      return '';
  }
};
github commercetools / merchant-center-application-kit / website-components-playground / src / pages / tabular-modal-page.js View on Github external
import TextInput from '@commercetools-uikit/text-input';
import { customProperties } from '@commercetools-uikit/design-system';
import LayoutApp from '../layouts/layout-app';
import PlaygroundController from '../components/playground-controller';
import ModalController from '../components/modal-controller';

const containerId = 'tabular-modal-page';

const TabControlsContainer = styled.div`
  min-height: 30px;
  display: flex;
  > * {
    min-width: 50px;
    cursor: pointer;
    &:first-of-type {
      border-bottom: 3px solid ${customProperties.colorPrimary};
      & > * {
        color: ${customProperties.colorPrimary};
      }
    }
  }
  > * + * {
    margin-left: 16px;
  }
`;

const exampleCustomTitleRow = (
  
    
      <label>
        
          Input 1</label>
github commercetools / ui-kit / src / components / internals / rich-text-body / dropdown.styles.js View on Github external
}
    `,
];

const DropdownContainer = styled.div`
  position: absolute;
  cursor: pointer;
  font-size: ${vars.fontSizeForInput};
  top: ${vars.spacingXs};
  margin-top: ${vars.spacingXs};
  left: 0;
  white-space: nowrap;
  background: ${vars.colorSurface};
  overflow: hidden;
  z-index: 9999;
  border: 1px solid ${vars.colorPrimary};
  border-radius: ${vars.borderRadius6};
`;

export { DropdownContainer, DropdownItem, getButtonStyles };

@commercetools-uikit/design-system

Core package of the commercetools design system.

MIT
Latest version published 5 days ago

Package Health Score

87 / 100
Full package analysis