Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upWhen using the core Components in layouts, developers will need to position them according to the design #75
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Goals
Aims
We want to be able to have the following options:
What we don't want to be able to do:
Ideally, positioning of the components will be defined via the style section of a layout and not in the functional component / layout definition.
In other words, all styles in one place, all component rendering in one place.
Option 1 - Props
Each component accepts props like:
positionmarginwidthheightflexThis option seems difficult to ensure every positional css rule is catered for, and non-positional ones are not.
Option 2 - Nothing (use wrapper)
Don't allow any customization. Instead, force everything to be wrapped with a client element that is explicitly sized and positioned.
This option means that all components that support being different widths (or heights) would need to size at 100% of the container, or have the option to. Then the container would be manually sized by the client.
Option 3 -
className(no wrapper)Our components can accept an additional class which can specify
Disadvantage is we need to explicitly pass the
classNameprop to the outermost element in the Component.Option 4 -
Component.extendI don’t believe this is really possible in most cases, because our Components are not styled-components, they use styled-components for their children.