diff --git a/img/layouts-add.png b/img/layouts-add.png new file mode 100644 index 0000000..94df2fd Binary files /dev/null and b/img/layouts-add.png differ diff --git a/user-guide/flexible-layouts/index.njk b/user-guide/flexible-layouts/index.njk index 337f203..fe04cc3 100644 --- a/user-guide/flexible-layouts/index.njk +++ b/user-guide/flexible-layouts/index.njk @@ -15,8 +15,10 @@ title: 08· Flexible Layouts

Flex Layout is based on Flexbox CSS standard

Penpot's Flex Layout is built over Flexbox, a CSS module that provides a more efficient way to lay out, align and distribute space among items in a container. As there are already many comprehensive explations about Flexbox we are not going to write another one. If you are interested we can recommend you to read the one at CSS Tricks.

+

Flex Layout

-Image from CSS Tricks +
Image from CSS Tricks
+

Add Flex Layout

@@ -26,7 +28,7 @@ title: 08· Flexible Layouts
  • From the option at the selection menu (right click button).
  • Pressing Ctrl/⌘ + A.
  • -

    Flex Layout

    +

    Adding Layouts

    Arrange and reorder objects to a Flex Layout

    @@ -92,7 +94,7 @@ title: 08· Flexible Layouts

    Grid Layout

    -

    Grid Layout allows you to efficiently organize, align, and distribute items in 2-dimensional layouts. You can create rows and columns of elements, giving you fine-grained control over their expansion, alignment, and responsiveness to various screen sizes.

    +

    Grid Layout allows you to efficiently organize, align, and distribute items in 2-dimensional layouts. You can create rows and columns of elements, giving you fine-grained control over their expansion, alignment, and responsiveness to various screen sizes. It's a powerful tool for creating responsive designs.

    Grid Layout is based on CSS Grid standard

    -

    Penpot's Grid Layout is built over CSS Grid, a fairly new CSS module that provides a more efficient way to lay out, align and distribute space among items in a container using two dimensions. If you are interested to know more about this CSS module we can recommend you to read this awesome Guide to CSS Grid at CSS Tricks.

    +

    Penpot's Grid Layout is built over CSS Grid, a fairly new CSS module. If you are interested to know more about this CSS module we recommend checking out the comprehensive explanation Guide to CSS Grid at CSS Tricks.

    Add Grid Layout

    @@ -111,43 +113,117 @@ title: 08· Flexible Layouts
  • From the option at the selection menu (right click button).
  • Pressing Ctrl/⌘ + Shift + A.
  • -

    Flex Layout

    +

    Adding Layouts

    + +

    Grid Layout properties

    +

    There are properties both for Grid containers and Grid items (cells, rows, cols). Those are the same properties that you can use with CSS Grid. You can read here detailed explanations about CSS Grid properties.

    + +

    Grid layout basic terminology

    + + + +

    Grid containter properties

    + + +

    Grid cell properties

    +Auto, manual and Area +

    These are different ways to manage the element's position that therefore have different code representation.

    + + +

    Align self (vertically and horizontally): Start, center, end, stretch.

    + + +

    Placing grid elements

    +

    To place elements inside a grid layout, just drag them or paste them in a cell or area.

    +

    Tip: Drag an element over a grid and then press Ctrl to place it as auto. That way the layer will be postioned automatically in the first available cell or area.

    + +

    Grid element properties

    + + + +

    Edit rows and columns

    +

    To edit grid layouts (rows, columns, units, cells, areas, etc) you can either select the board and press the "Edit grid" button or double click over the board.

    +

    You have several ways to edit rows and columns:

    + +

    Design sidebar

    +

    From the design sidebar you will be able to:

    + +

    Tip: You cand drag columns and rows while leaving the elements in the same position if you perform the action while pressing Ctrl.

    + +

    Design viewport

    +

    From the design viewport you will be able to:

    + +

    Tip: You cand drag columns and rows while leaving the elements in the same position if you perform the action while pressing Ctrl.

    + +

    Contextual menu

    +

    To launch the contextual menu of rows and columns you can right click over a column or row header or left click on the menu button.

    +

    From the contextual menu of rows and columns you will be able to:

    + + +

    Grid units

    +

    You can use different units at your grid columns and cells:

    + + +

    Areas

    +

    Areas are composition of any number of grid cells.

    + +

    Create areas

    +

    You have two ways to create areas:

    +

    1. Select more than one cell pressing left click while Ctrl), then press right click to open the menu and then press the option "Merge cells".

    + +

    2. Select one cell pressing left click, then hover near the limit to the cell you want to merge the selected cell with until the cursor changes. Then drag the cursor to merge the selected area to other areas in the same direction.

    + + +

    Name areas

    +

    To name an area, select the "Area" option at the grid cell properties (right sidebar) and fill the name of the area.

    + +

    Undo areas

    +

    To turn areas back to regular cells, just select the "Auto" option at the grid cell properties (right sidebar).

    + + +

    Grid code and specifications

    +

    Grid layout at Penpot behaves just like CSS Grid because is actually using the CSS Grid standard. This means that you can just switch to Inspect mode, get the code and use it in real websites.

    - -management -- sidebar -- board - -properties -- positioning -- alignment -- direction - -Edition -- Col & rows -- Units (fr, auto, px) -- Cells & Areas - naming - -code -- html & css - -use cases -- magazine -- table -- bento grid - - -Differences grid flex -- direction -- space control -- complexity -- use cases - -keyboard -- crear Shift -- ctrl drag -- drag shapes en grid con ctrl para que la shape la ponga en auto - -