0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 23:49:45 -05:00

Adds grid to the actibable features

This commit is contained in:
alonso.torres 2023-07-10 11:27:43 +02:00
parent ac184a7c8f
commit da9fa31c27
6 changed files with 10 additions and 7 deletions

View file

@ -119,7 +119,7 @@ $width-settings-bar: 256px;
}
}
&.settings-bar-right, {
&.settings-bar-right {
width: 100%;
}
}

View file

@ -421,7 +421,6 @@
visibility: visible;
}
}
}
.code-row-display {

View file

@ -20,7 +20,7 @@
(log/set-level! :warn)
(def available-features
#{:auto-layout :components-v2 :new-css-system})
#{:components-v2 :new-css-system :grid-layout})
(defn- toggle-feature
[feature]

View file

@ -12,6 +12,7 @@
[app.common.types.shape.layout :as ctl]
[app.main.data.workspace :as udw]
[app.main.data.workspace.shape-layout :as dwsl]
[app.main.features :as features]
[app.main.refs :as refs]
[app.main.store :as st]
[app.main.ui.components.numeric-input :refer [numeric-input]]
@ -602,20 +603,20 @@
(if (= type :row)
(st/emit! (dwsl/update-layout ids {:layout-justify-content value}))
(st/emit! (dwsl/update-layout ids {:layout-align-content value})))))]
[:div.element-set
[:div.element-set-title
[:*
[:span "Layout"]
(if (and (not multiple) (:layout values))
[:div.title-actions
[:div.layout-btns
(when (features/active-feature? :grid-layout)
[:div.layout-btns
[:button {:on-click set-flex
:class (dom/classnames
:active (= :flex layout-type))} "Flex"]
[:button {:on-click set-grid
:class (dom/classnames
:active (= :grid layout-type))} "Grid"]]
:active (= :grid layout-type))} "Grid"]])
[:button.remove-layout {:on-click on-remove-layout} i/minus]]
[:button.add-page {:on-click #(on-add-layout :flex)} i/close])]]

View file

@ -32,7 +32,7 @@
}
.grid-frame {
fill: #F6F6F6;
fill: #f6f6f6;
stroke: var(--color-distance);
stroke-width: calc(1 / var(--zoom));
}

View file

@ -19,3 +19,6 @@
(defn ^:export new-css-system []
(features/toggle-feature! :new-css-system))
(defn ^:export grid []
(features/toggle-feature! :grid-layout))