mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-19 11:41:32 +03:00
Generally, clickable svgs are square
This commit is contained in:
parent
0eefc2a714
commit
44aa1b4d4d
@ -3,7 +3,7 @@ module Nri.Ui.ClickableSvg.V2 exposing
|
||||
, Attribute
|
||||
, onClick
|
||||
, href, linkSpa, linkExternal, linkWithMethod, linkWithTracking, linkExternalWithTracking
|
||||
, exactWidth, exactHeight
|
||||
, exactSize, exactWidth, exactHeight
|
||||
, disabled
|
||||
, withBorder
|
||||
, primary, secondary, danger, dangerSecondary
|
||||
@ -34,7 +34,7 @@ module Nri.Ui.ClickableSvg.V2 exposing
|
||||
|
||||
## Sizing
|
||||
|
||||
@docs exactWidth, exactHeight
|
||||
@docs exactSize, exactWidth, exactHeight
|
||||
|
||||
|
||||
## State
|
||||
@ -189,6 +189,26 @@ large =
|
||||
set (\attributes -> { attributes | size = Large })
|
||||
|
||||
|
||||
{-| Set the size in `px` for the element's width and height.
|
||||
|
||||
Equivalent to:
|
||||
|
||||
[ exactWidth inPx
|
||||
, exactHeight inPx
|
||||
]
|
||||
|
||||
-}
|
||||
exactSize : Int -> Attribute msg
|
||||
exactSize inPx =
|
||||
set
|
||||
(\attributes ->
|
||||
{ attributes
|
||||
| width = Just (toFloat inPx)
|
||||
, height = Just (toFloat inPx)
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
{-| Define a size in `px` for the element's total width.
|
||||
-}
|
||||
exactWidth : Int -> Attribute msg
|
||||
|
@ -269,8 +269,6 @@ initSettings =
|
||||
(ControlExtra.list
|
||||
|> ControlExtra.listItem "disabled"
|
||||
(Control.map ClickableSvg.disabled (Control.bool False))
|
||||
|> ControlExtra.optionalListItem "exactWidth"
|
||||
(Control.map ClickableSvg.exactWidth (ControlExtra.int 40))
|
||||
|> ControlExtra.optionalListItem "exactHeight"
|
||||
(Control.map ClickableSvg.exactHeight (ControlExtra.int 20))
|
||||
|> ControlExtra.optionalListItem "exactSize"
|
||||
(Control.map ClickableSvg.exactSize (ControlExtra.int 36))
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user