UNPKG

@carbon/ibm-products

Version:

Carbon for IBM Products

27 lines (23 loc) 733 B
/** * Copyright IBM Corp. 2020, 2025 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { baseFontSize, sizeSmall, sizeLarge, sizeMedium, sizeXSmall } from '@carbon/layout'; const getSizeInPixels = carbonSize => Number(carbonSize.replace('rem', '') * baseFontSize); const getCellSize = cellSize => { switch (cellSize) { case 'xs': return getSizeInPixels(sizeXSmall); case 'sm': return getSizeInPixels(sizeSmall); case 'md': return getSizeInPixels(sizeMedium); case 'lg': return getSizeInPixels(sizeLarge); default: return getSizeInPixels(sizeSmall); } }; export { getCellSize };