.expandable-cell { display: block; // stack: button on top, content below .expandable-cell__button { border: none; background: transparent; padding: 0; cursor: pointer; color: inherit; font-size: 1rem; display: inline-flex; align-items: center; gap: 0.25rem; } .expandable-cell__title { margin-right: 0.25rem; font-size: 0.95rem; line-height: 1; } .expandable-cell__content_defaults { max-width: 600px; max-height: 600px; } .expandable-cell__content { margin-top: 0.5rem; width: 100%; overflow-x: auto; /* horizontal scrollbar always visible if needed */ overflow-y: auto; /* vertical scrollbar always visible if needed */ transition: height 240ms ease; } .expandable-cell__content-inner { transition: opacity 180ms ease; opacity: 1; min-width: max-content; /* allow long lines to trigger horizontal scroll */ width: fit-content; /* Remove overflow properties from here */ height: 100%; } .expandable-cell__icon { display: inline-block; transform-origin: center; transition: transform 180ms ease; transform: rotate(0deg); } &.is-open { .expandable-cell__icon { transform: rotate(90deg); } } &:not(.is-open) { .expandable-cell__content-inner { opacity: 0; } } }