Skip to content

How can I solve this problem? #758

Closed Answered by nmn
keyasc asked this question in Q&A
Oct 28, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

I want to start off by saying that such patterns for defining number of columns lead to inconsistencies and the StyleX API was designed specifically to discourage such APIs.

Instead of defining the number of columns, a responsive design system to should as for a min-width and be fluid automatically.

import * as stylex from "@stylexjs/stylex";

type ColProps = {
  children: React.ReactNode;
  fluid?: boolean;
  style: StyleXStyles<{
    flexBasis: number | string;
    minWidth?: number | string;
  }>;
};

const row_styles = stylex.create({
  row: {
    display: 'flex',
    flexWrap: 'wrap',
  },
  column: {
    flexShrink: 0,
    flexBasis: 'auto',
    maxWidth: "100%",
  },
  fluid: {
    f…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@keyasc
Comment options

@nmn
Comment options

nmn Oct 28, 2024
Collaborator

@keyasc
Comment options

Answer selected by keyasc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants