carbon icon indicating copy to clipboard operation
carbon copied to clipboard

Sidebar custom sizes

Open rawlmp opened this issue 2 years ago • 6 comments

Desired behaviour

It should accept the same values as other components (as the Box, for example).

This way we can change the with using px, vw or percentages and we can adapt the size to each responsive size.

Current behaviour

Currently, there are 6 predefined sizes extra-small; small; medium-small; medium; medium-large; large; extra-large.

Suggested Solution

SBS-40387

CodeSandbox or Storybook URL

It's a default carbon component

Anything else we should know?

We have a Figma resource created by SD. I can't paste here any reference to it.

Confidentiality

  • [X] I confirm there is no confidential or commercially sensitive information included.

rawlmp avatar Aug 18 '22 07:08 rawlmp

Hi @rawlmp, similarly with issue #5394, I could imagine because this is default styling with the Sidebar component, that the size of sidebar should be kept as it is. Unless DS have given us official approval to introduce this, it could potentially lead to inconsistency among products.

@ljemmo @harpalsingh is something we would like to introduce?

Parsium avatar Aug 30 '22 13:08 Parsium

@Parsium and @rawlmp will need more context before i can review. Pelase can you share a spec or design.

ljemmo avatar Aug 31 '22 16:08 ljemmo

In our repo we need to define sidebar width to be "auto" for mobile screen sizes to support a responsive UI, could we do this, please?

StylianosKoidakisSage avatar Sep 07 '22 14:09 StylianosKoidakisSage

Having reviewed @lukepricesage designs, i think adding an optional width prop that allows passing of custom width depending on resolution makes sense. Just to confirm @StylianosKoidakisSage - this wouldn't replace the fixed width sizes that we currently support - rather it would be an additional prop that could override these?

ljemmo avatar Sep 07 '22 15:09 ljemmo

@ljemmo with regards to the existing size prop for Sidebar - one potential solution would be to create a codemod that consumers can run on their code that renames the size prop to a width prop with a particular value. I'll add this to our backlog for now and we will discuss options in our refinement session

Parsium avatar Sep 08 '22 08:09 Parsium

FE-5359

Parsium avatar Sep 08 '22 09:09 Parsium

Fixed in https://github.com/Sage/carbon/pull/5604

nicktitchmarsh avatar Apr 20 '23 13:04 nicktitchmarsh