Skip to content

Commit

Permalink
Add GridLayout1
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirlogachev committed May 2, 2024
1 parent 7fa5a2a commit bd1bad7
Show file tree
Hide file tree
Showing 7 changed files with 382 additions and 13 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The full potential of modular grid design will be realized if the layouts are de
- Responsive grid columns (step width is variable, columns can grow, but gutter and minimal margin are fixed).
- Allows to establish a vertical rhythm using column width, and maintain proportions of the grid elements on different screen sizes.

## Example usage with `elm-land` and `elm-ui`
## Example usage of `GridLayout2` (2-screen version) with `elm-land` and `elm-ui`

### `elm.json`

Expand Down Expand Up @@ -219,3 +219,11 @@ viewDesktop layout =
```

[Complete example code](https://github.com/vladimirlogachev/elm-modular-grid/tree/main/example).

## Switching between versions

Here's how you can switch from 2-screen to 3-screen (or 1-screen) version:

- replace `GridLayout2` with `GridLayout3` everywhere in your code
- update `layoutConfig`
- follow compiler errors to adjust pattern matching of `ScreenClass`.
2 changes: 1 addition & 1 deletion elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"summary": "Responsive modular grid layouts for Elm",
"license": "MIT",
"version": "1.0.0",
"exposed-modules": ["GridLayout2", "GridLayout3"],
"exposed-modules": ["GridLayout1", "GridLayout2", "GridLayout3"],
"source-directories": ["src"],
"elm-version": "0.19.1 <= v < 0.20.0",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion example/review/src/ReviewConfig.elm
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ config =
, NoUnused.Patterns.rule
, NoExposingEverything.rule
, NoUnused.Variables.rule
, NoImportingEverything.rule [ "Element", "GridLayout2" ]
, NoImportingEverything.rule [ "Element", "GridLayout1", "GridLayout2", "GridLayout3" ]
, NoMissingTypeAnnotation.rule
, NoMissingTypeAnnotationInLetIn.rule
, NoPrematureLetComputation.rule
Expand Down
8 changes: 4 additions & 4 deletions review/src/ReviewConfig.elm
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ config =
, NoMissingSubscriptionsCall.rule
, NoRecursiveUpdate.rule
, NoUselessSubscriptions.rule
, NoUnsafeDivision.rule |> Rule.ignoreErrorsForFiles [ "src/GridLayout2.elm", "src/GridLayout3.elm" ]
, NoUnused.CustomTypeConstructors.rule [] |> Rule.ignoreErrorsForFiles [ "src/GridLayout2.elm", "src/GridLayout3.elm" ]
, NoUnused.CustomTypeConstructorArgs.rule |> Rule.ignoreErrorsForFiles [ "src/GridLayout2.elm", "src/GridLayout3.elm" ]
, NoUnsafeDivision.rule |> Rule.ignoreErrorsForFiles [ "src/GridLayout1.elm", "src/GridLayout2.elm", "src/GridLayout3.elm" ]
, NoUnused.CustomTypeConstructors.rule [] |> Rule.ignoreErrorsForFiles [ "src/GridLayout1.elm", "src/GridLayout2.elm", "src/GridLayout3.elm" ]
, NoUnused.CustomTypeConstructorArgs.rule |> Rule.ignoreErrorsForFiles [ "src/GridLayout1.elm", "src/GridLayout2.elm", "src/GridLayout3.elm" ]
, NoUnused.Dependencies.rule
, NoUnused.Exports.rule |> Rule.ignoreErrorsForFiles [ "src/GridLayout2.elm", "src/GridLayout3.elm" ]
, NoUnused.Exports.rule |> Rule.ignoreErrorsForFiles [ "src/GridLayout1.elm", "src/GridLayout2.elm", "src/GridLayout3.elm" ]
, NoUnused.Modules.rule
, NoUnused.Parameters.rule
, NoUnused.Patterns.rule
Expand Down
Loading

0 comments on commit bd1bad7

Please sign in to comment.