Skip to content

Commit

Permalink
Update FlexContainer.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
vanvianen committed Jan 12, 2025
1 parent c6e5c15 commit c2a8b3f
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions src/ts/FlexContainer.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
// ============================================================================
// Import
// ============================================================================


// ============================================================================
// Types
// ============================================================================

type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
type FlexWrap = 'nowrap' | 'wrap' | 'wrap-reverse';

class FlexContainer {
// ============================================================================
// Classes
// ============================================================================



export default class FlexContainer {

// Parameters
// ========================================================================

flexDirection: FlexDirection;
flexWrap: FlexWrap;
justifyContent: Justify;
alignItems: Align;
alignContent: Align;


// Constructor
// ========================================================================

constructor(
flexDirection: FlexDirection = 'row',
flexWrap: FlexWrap = 'nowrap',
Expand All @@ -22,6 +45,10 @@ class FlexContainer {
this.alignContent = alignContent;
}


// Methods
// ========================================================================

setDirection(direction: FlexDirection): void {
this.flexDirection = direction;
}
Expand All @@ -45,4 +72,4 @@ class FlexContainer {
toString(): string {
return `FlexContainer: direction ${this.flexDirection}, wrap ${this.flexWrap}, justify ${this.justifyContent}, align-items ${this.alignItems}, align-content ${this.alignContent}`;
}
}
}

0 comments on commit c2a8b3f

Please sign in to comment.