diff --git a/CHANGELOG.md b/CHANGELOG.md index 912b24c..bf48240 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [11.1.4](https://github.com/phun-ky/speccer/compare/v11.1.3...v11.1.4) (2024-11-18) + + +### Bug + +* 🐛 Make sure spacing is including children again ([749e1b1](https://github.com/phun-ky/speccer/commit/749e1b1f13e7e8ebbf6d790018a026c501fc1feb)) + ## [11.1.3](https://github.com/phun-ky/speccer/compare/v11.1.2...v11.1.3) (2024-11-18) diff --git a/api/README.md b/api/README.md index e462987..0d63cb2 100644 --- a/api/README.md +++ b/api/README.md @@ -8,7 +8,7 @@ --- -> Last updated 2024-11-18T09:12:16.661Z +> Last updated 2024-11-18T11:00:02.709Z ## Modules diff --git a/api/config/browser.md b/api/config/browser.md index 83d21e3..ec01a4e 100644 --- a/api/config/browser.md +++ b/api/config/browser.md @@ -6,7 +6,7 @@ # config/browser -> Last updated 2024-11-18T09:12:16.663Z +> Last updated 2024-11-18T11:00:02.711Z Contains the helper functions to activate SPECCER via a script tag, based on attributes: diff --git a/api/features/a11y.md b/api/features/a11y.md index 98adb91..6008919 100644 --- a/api/features/a11y.md +++ b/api/features/a11y.md @@ -6,7 +6,7 @@ # features/a11y -> Last updated 2024-11-18T09:12:16.667Z +> Last updated 2024-11-18T11:00:02.715Z This feature will annotate or highlight accessibility areas like landmarks and region. It can also display tab stops/sequence and any keyboard shortcuts assigned @@ -55,7 +55,7 @@ a11y(); #### Defined in -[features/a11y/index.ts:148](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L148) +[features/a11y/index.ts:150](https://github.com/phun-ky/speccer/blob/main/src/features/a11y/index.ts#L150) --- diff --git a/api/features/a11y/constants.md b/api/features/a11y/constants.md index 7e85fe3..e0362a5 100644 --- a/api/features/a11y/constants.md +++ b/api/features/a11y/constants.md @@ -6,7 +6,7 @@ # features/a11y/constants -> Last updated 2024-11-18T09:12:16.668Z +> Last updated 2024-11-18T11:00:02.716Z ## Variables diff --git a/api/features/a11y/utils/create-a11y-element.md b/api/features/a11y/utils/create-a11y-element.md index 8f923c5..06543fd 100644 --- a/api/features/a11y/utils/create-a11y-element.md +++ b/api/features/a11y/utils/create-a11y-element.md @@ -6,7 +6,7 @@ # features/a11y/utils/create-a11y-element -> Last updated 2024-11-18T09:12:16.670Z +> Last updated 2024-11-18T11:00:02.718Z ## Functions diff --git a/api/features/a11y/utils/styles.md b/api/features/a11y/utils/styles.md index 158ea87..1caf424 100644 --- a/api/features/a11y/utils/styles.md +++ b/api/features/a11y/utils/styles.md @@ -6,7 +6,7 @@ # features/a11y/utils/styles -> Last updated 2024-11-18T09:12:16.671Z +> Last updated 2024-11-18T11:00:02.719Z ## Functions diff --git a/api/features/grid.md b/api/features/grid.md index b03f221..fcaef03 100644 --- a/api/features/grid.md +++ b/api/features/grid.md @@ -6,7 +6,7 @@ # features/grid -> Last updated 2024-11-18T09:12:16.671Z +> Last updated 2024-11-18T11:00:02.719Z This feature will highlight the grid spacing in a `display: grid;` element. @@ -128,7 +128,7 @@ grid(targetElement, options); #### Defined in -[features/grid/index.ts:197](https://github.com/phun-ky/speccer/blob/main/src/features/grid/index.ts#L197) +[features/grid/index.ts:202](https://github.com/phun-ky/speccer/blob/main/src/features/grid/index.ts#L202) --- diff --git a/api/features/mark.md b/api/features/mark.md index f6a0261..99c0aef 100644 --- a/api/features/mark.md +++ b/api/features/mark.md @@ -6,7 +6,7 @@ # features/mark -> Last updated 2024-11-18T09:12:16.672Z +> Last updated 2024-11-18T11:00:02.720Z This feature marks given element diff --git a/api/features/measure.md b/api/features/measure.md index 8aca8a1..e7e5aa5 100644 --- a/api/features/measure.md +++ b/api/features/measure.md @@ -6,7 +6,7 @@ # features/measure -> Last updated 2024-11-18T09:12:16.673Z +> Last updated 2024-11-18T11:00:02.721Z This feature measures given element diff --git a/api/features/pin.md b/api/features/pin.md index b740548..113d305 100644 --- a/api/features/pin.md +++ b/api/features/pin.md @@ -6,7 +6,7 @@ # features/pin -> Last updated 2024-11-18T09:12:16.674Z +> Last updated 2024-11-18T11:00:02.722Z This feature annotate or highlight the anatomy of an element. diff --git a/api/features/pin/utils/create-pin-element.md b/api/features/pin/utils/create-pin-element.md index ec28ede..c6ac90c 100644 --- a/api/features/pin/utils/create-pin-element.md +++ b/api/features/pin/utils/create-pin-element.md @@ -6,7 +6,7 @@ # features/pin/utils/create-pin-element -> Last updated 2024-11-18T09:12:16.675Z +> Last updated 2024-11-18T11:00:02.722Z ## Functions diff --git a/api/features/pin/utils/get-character-to-use.md b/api/features/pin/utils/get-character-to-use.md index f04049f..f39f8dd 100644 --- a/api/features/pin/utils/get-character-to-use.md +++ b/api/features/pin/utils/get-character-to-use.md @@ -6,7 +6,7 @@ # features/pin/utils/get-character-to-use -> Last updated 2024-11-18T09:12:16.675Z +> Last updated 2024-11-18T11:00:02.723Z ## Functions diff --git a/api/features/pin/utils/get-content-for-pin.md b/api/features/pin/utils/get-content-for-pin.md index 441e990..54520fb 100644 --- a/api/features/pin/utils/get-content-for-pin.md +++ b/api/features/pin/utils/get-content-for-pin.md @@ -6,7 +6,7 @@ # features/pin/utils/get-content-for-pin -> Last updated 2024-11-18T09:12:16.675Z +> Last updated 2024-11-18T11:00:02.723Z ## Functions diff --git a/api/features/pin/utils/pin-element.md b/api/features/pin/utils/pin-element.md index e3b290e..3c4a968 100644 --- a/api/features/pin/utils/pin-element.md +++ b/api/features/pin/utils/pin-element.md @@ -6,7 +6,7 @@ # features/pin/utils/pin-element -> Last updated 2024-11-18T09:12:16.676Z +> Last updated 2024-11-18T11:00:02.723Z ## Functions diff --git a/api/features/pin/utils/styles.md b/api/features/pin/utils/styles.md index f20ce1c..d18c0bc 100644 --- a/api/features/pin/utils/styles.md +++ b/api/features/pin/utils/styles.md @@ -6,7 +6,7 @@ # features/pin/utils/styles -> Last updated 2024-11-18T09:12:16.676Z +> Last updated 2024-11-18T11:00:02.724Z ## Functions diff --git a/api/features/spacing.md b/api/features/spacing.md index 7dbbee8..c8be0f1 100644 --- a/api/features/spacing.md +++ b/api/features/spacing.md @@ -6,7 +6,7 @@ # features/spacing -> Last updated 2024-11-18T09:12:16.676Z +> Last updated 2024-11-18T11:00:02.724Z This feature highlights the spacing of an element. diff --git a/api/features/spacing/utils/position.md b/api/features/spacing/utils/position.md index 9422d7c..38a1f4f 100644 --- a/api/features/spacing/utils/position.md +++ b/api/features/spacing/utils/position.md @@ -6,7 +6,7 @@ # features/spacing/utils/position -> Last updated 2024-11-18T09:12:16.677Z +> Last updated 2024-11-18T11:00:02.725Z ## Functions diff --git a/api/features/typography.md b/api/features/typography.md index f79b5dc..014756f 100644 --- a/api/features/typography.md +++ b/api/features/typography.md @@ -6,7 +6,7 @@ # features/typography -> Last updated 2024-11-18T09:12:16.677Z +> Last updated 2024-11-18T11:00:02.725Z This feature presents typography diff --git a/api/features/typography/utils/position.md b/api/features/typography/utils/position.md index 322c498..3e6510d 100644 --- a/api/features/typography/utils/position.md +++ b/api/features/typography/utils/position.md @@ -6,7 +6,7 @@ # features/typography/utils/position -> Last updated 2024-11-18T09:12:16.678Z +> Last updated 2024-11-18T11:00:02.726Z ## Functions diff --git a/api/features/typography/utils/template.md b/api/features/typography/utils/template.md index 6e1b6bf..2285f81 100644 --- a/api/features/typography/utils/template.md +++ b/api/features/typography/utils/template.md @@ -6,7 +6,7 @@ # features/typography/utils/template -> Last updated 2024-11-18T09:12:16.679Z +> Last updated 2024-11-18T11:00:02.727Z ## Functions diff --git a/api/main.md b/api/main.md index 70620ce..0ad5b5b 100644 --- a/api/main.md +++ b/api/main.md @@ -6,7 +6,7 @@ # main -> Last updated 2024-11-18T09:12:16.679Z +> Last updated 2024-11-18T11:00:02.727Z ## Table of Contents diff --git a/api/types/bezier.md b/api/types/bezier.md index 82e13c3..e69c6c9 100644 --- a/api/types/bezier.md +++ b/api/types/bezier.md @@ -6,7 +6,7 @@ # types/bezier -> Last updated 2024-11-18T09:12:16.681Z +> Last updated 2024-11-18T11:00:02.729Z ## Type Aliases diff --git a/api/types/css.md b/api/types/css.md index ca5cfbf..2726751 100644 --- a/api/types/css.md +++ b/api/types/css.md @@ -6,7 +6,7 @@ # types/css -> Last updated 2024-11-18T09:12:16.682Z +> Last updated 2024-11-18T11:00:02.730Z ## Type Aliases diff --git a/api/types/debounce.md b/api/types/debounce.md index b13471d..018834f 100644 --- a/api/types/debounce.md +++ b/api/types/debounce.md @@ -6,7 +6,7 @@ # types/debounce -> Last updated 2024-11-18T09:12:16.683Z +> Last updated 2024-11-18T11:00:02.731Z ## Type Aliases diff --git a/api/types/enums/area.md b/api/types/enums/area.md index 4c58885..5a8f541 100644 --- a/api/types/enums/area.md +++ b/api/types/enums/area.md @@ -6,7 +6,7 @@ # types/enums/area -> Last updated 2024-11-18T09:12:16.683Z +> Last updated 2024-11-18T11:00:02.731Z ## Enumerations diff --git a/api/types/interfaces/attributes.md b/api/types/interfaces/attributes.md index 8064288..92c601b 100644 --- a/api/types/interfaces/attributes.md +++ b/api/types/interfaces/attributes.md @@ -6,7 +6,7 @@ # types/interfaces/attributes -> Last updated 2024-11-18T09:12:16.684Z +> Last updated 2024-11-18T11:00:02.732Z ## Interfaces diff --git a/api/types/interfaces/classnames.md b/api/types/interfaces/classnames.md index 217b25b..11fd5e0 100644 --- a/api/types/interfaces/classnames.md +++ b/api/types/interfaces/classnames.md @@ -6,7 +6,7 @@ # types/interfaces/classnames -> Last updated 2024-11-18T09:12:16.684Z +> Last updated 2024-11-18T11:00:02.732Z ## Type Aliases diff --git a/api/types/interfaces/global.md b/api/types/interfaces/global.md index 707aeda..b075f9e 100644 --- a/api/types/interfaces/global.md +++ b/api/types/interfaces/global.md @@ -6,7 +6,7 @@ # types/interfaces/global -> Last updated 2024-11-18T09:12:16.685Z +> Last updated 2024-11-18T11:00:02.733Z ## Interfaces diff --git a/api/types/interfaces/position.md b/api/types/interfaces/position.md index 19e3e81..e018872 100644 --- a/api/types/interfaces/position.md +++ b/api/types/interfaces/position.md @@ -6,7 +6,7 @@ # types/interfaces/position -> Last updated 2024-11-18T09:12:16.685Z +> Last updated 2024-11-18T11:00:02.733Z ## Interfaces diff --git a/api/types/position.md b/api/types/position.md index 4d1f45d..52d4253 100644 --- a/api/types/position.md +++ b/api/types/position.md @@ -6,7 +6,7 @@ # types/position -> Last updated 2024-11-18T09:12:16.686Z +> Last updated 2024-11-18T11:00:02.734Z ## Type Aliases diff --git a/api/types/speccer.md b/api/types/speccer.md index c70438c..7a4fcf1 100644 --- a/api/types/speccer.md +++ b/api/types/speccer.md @@ -6,7 +6,7 @@ # types/speccer -> Last updated 2024-11-18T09:12:16.686Z +> Last updated 2024-11-18T11:00:02.734Z ## Table of Contents diff --git a/api/types/styles.md b/api/types/styles.md index 1606274..3563e41 100644 --- a/api/types/styles.md +++ b/api/types/styles.md @@ -6,7 +6,7 @@ # types/styles -> Last updated 2024-11-18T09:12:16.687Z +> Last updated 2024-11-18T11:00:02.735Z ## Type Aliases diff --git a/api/types/xy.md b/api/types/xy.md index adad790..913ddc3 100644 --- a/api/types/xy.md +++ b/api/types/xy.md @@ -6,7 +6,7 @@ # types/xy -> Last updated 2024-11-18T09:12:16.687Z +> Last updated 2024-11-18T11:00:02.735Z ## Interfaces diff --git a/api/utils/angle.md b/api/utils/angle.md index 71e285c..7c864cc 100644 --- a/api/utils/angle.md +++ b/api/utils/angle.md @@ -6,7 +6,7 @@ # utils/angle -> Last updated 2024-11-18T09:12:16.688Z +> Last updated 2024-11-18T11:00:02.736Z ## Functions diff --git a/api/utils/area.md b/api/utils/area.md index 708207d..e700d4d 100644 --- a/api/utils/area.md +++ b/api/utils/area.md @@ -6,7 +6,7 @@ # utils/area -> Last updated 2024-11-18T09:12:16.688Z +> Last updated 2024-11-18T11:00:02.736Z ## Functions diff --git a/api/utils/attributes.md b/api/utils/attributes.md index fb66f04..f099287 100644 --- a/api/utils/attributes.md +++ b/api/utils/attributes.md @@ -6,7 +6,7 @@ # utils/attributes -> Last updated 2024-11-18T09:12:16.690Z +> Last updated 2024-11-18T11:00:02.738Z ## Functions diff --git a/api/utils/bezier.md b/api/utils/bezier.md index c08360a..ad47537 100644 --- a/api/utils/bezier.md +++ b/api/utils/bezier.md @@ -6,7 +6,7 @@ # utils/bezier -> Last updated 2024-11-18T09:12:16.690Z +> Last updated 2024-11-18T11:00:02.738Z ## Functions diff --git a/api/utils/camel-case.md b/api/utils/camel-case.md index 889d561..5bae849 100644 --- a/api/utils/camel-case.md +++ b/api/utils/camel-case.md @@ -6,7 +6,7 @@ # utils/camel-case -> Last updated 2024-11-18T09:12:16.691Z +> Last updated 2024-11-18T11:00:02.739Z ## Functions diff --git a/api/utils/cardinal.md b/api/utils/cardinal.md index 4d2b48a..4870f7f 100644 --- a/api/utils/cardinal.md +++ b/api/utils/cardinal.md @@ -6,7 +6,7 @@ # utils/cardinal -> Last updated 2024-11-18T09:12:16.691Z +> Last updated 2024-11-18T11:00:02.739Z ## Functions diff --git a/api/utils/classes/DrawCircle.md b/api/utils/classes/DrawCircle.md index f614871..6592451 100644 --- a/api/utils/classes/DrawCircle.md +++ b/api/utils/classes/DrawCircle.md @@ -6,7 +6,7 @@ # utils/classes/DrawCircle -> Last updated 2024-11-18T09:12:16.691Z +> Last updated 2024-11-18T11:00:02.740Z ## Classes diff --git a/api/utils/classes/DrawSVGCurlyBracket.md b/api/utils/classes/DrawSVGCurlyBracket.md index 5742956..8fa0c31 100644 --- a/api/utils/classes/DrawSVGCurlyBracket.md +++ b/api/utils/classes/DrawSVGCurlyBracket.md @@ -6,7 +6,7 @@ # utils/classes/DrawSVGCurlyBracket -> Last updated 2024-11-18T09:12:16.692Z +> Last updated 2024-11-18T11:00:02.740Z ## Classes diff --git a/api/utils/classes/DrawSVGLine.md b/api/utils/classes/DrawSVGLine.md index 52c8c08..2c9a40b 100644 --- a/api/utils/classes/DrawSVGLine.md +++ b/api/utils/classes/DrawSVGLine.md @@ -6,7 +6,7 @@ # utils/classes/DrawSVGLine -> Last updated 2024-11-18T09:12:16.693Z +> Last updated 2024-11-18T11:00:02.741Z ## Classes diff --git a/api/utils/classnames.md b/api/utils/classnames.md index df3297b..3a9279d 100644 --- a/api/utils/classnames.md +++ b/api/utils/classnames.md @@ -6,7 +6,7 @@ # utils/classnames -> Last updated 2024-11-18T09:12:16.693Z +> Last updated 2024-11-18T11:00:02.741Z ## Functions diff --git a/api/utils/constants.md b/api/utils/constants.md index 2b6469a..72c46a2 100644 --- a/api/utils/constants.md +++ b/api/utils/constants.md @@ -6,7 +6,7 @@ # utils/constants -> Last updated 2024-11-18T09:12:16.694Z +> Last updated 2024-11-18T11:00:02.742Z ## Variables diff --git a/api/utils/coords.md b/api/utils/coords.md index 86fbd83..1c9de0e 100644 --- a/api/utils/coords.md +++ b/api/utils/coords.md @@ -6,7 +6,7 @@ # utils/coords -> Last updated 2024-11-18T09:12:16.695Z +> Last updated 2024-11-18T11:00:02.743Z ## Variables diff --git a/api/utils/css.md b/api/utils/css.md index 2c63bc3..ff18940 100644 --- a/api/utils/css.md +++ b/api/utils/css.md @@ -6,7 +6,7 @@ # utils/css -> Last updated 2024-11-18T09:12:16.695Z +> Last updated 2024-11-18T11:00:02.743Z ## Functions diff --git a/api/utils/debounce.md b/api/utils/debounce.md index a9acb29..958a1c2 100644 --- a/api/utils/debounce.md +++ b/api/utils/debounce.md @@ -6,7 +6,7 @@ # utils/debounce -> Last updated 2024-11-18T09:12:16.696Z +> Last updated 2024-11-18T11:00:02.744Z ## Functions diff --git a/api/utils/direction-of-element.md b/api/utils/direction-of-element.md index a3a2402..b67e587 100644 --- a/api/utils/direction-of-element.md +++ b/api/utils/direction-of-element.md @@ -6,7 +6,7 @@ # utils/direction-of-element -> Last updated 2024-11-18T09:12:16.696Z +> Last updated 2024-11-18T11:00:02.744Z ## Functions diff --git a/api/utils/get-coords-pair-from-objects.md b/api/utils/get-coords-pair-from-objects.md index 4d079d7..58945cd 100644 --- a/api/utils/get-coords-pair-from-objects.md +++ b/api/utils/get-coords-pair-from-objects.md @@ -6,7 +6,7 @@ # utils/get-coords-pair-from-objects -> Last updated 2024-11-18T09:12:16.696Z +> Last updated 2024-11-18T11:00:02.745Z ## Functions diff --git a/api/utils/get-options.md b/api/utils/get-options.md index 80d6079..80c0f61 100644 --- a/api/utils/get-options.md +++ b/api/utils/get-options.md @@ -6,7 +6,7 @@ # utils/get-options -> Last updated 2024-11-18T09:12:16.697Z +> Last updated 2024-11-18T11:00:02.745Z ## Functions diff --git a/api/utils/id.md b/api/utils/id.md index 900d76b..742d86a 100644 --- a/api/utils/id.md +++ b/api/utils/id.md @@ -6,7 +6,7 @@ # utils/id -> Last updated 2024-11-18T09:12:16.697Z +> Last updated 2024-11-18T11:00:02.745Z ## Functions diff --git a/api/utils/intrinsic-coords.md b/api/utils/intrinsic-coords.md index 2f457ba..534f8d5 100644 --- a/api/utils/intrinsic-coords.md +++ b/api/utils/intrinsic-coords.md @@ -6,7 +6,7 @@ # utils/intrinsic-coords -> Last updated 2024-11-18T09:12:16.697Z +> Last updated 2024-11-18T11:00:02.745Z ## Functions diff --git a/api/utils/node.md b/api/utils/node.md index a630e9d..454e88e 100644 --- a/api/utils/node.md +++ b/api/utils/node.md @@ -6,7 +6,7 @@ # utils/node -> Last updated 2024-11-18T09:12:16.698Z +> Last updated 2024-11-18T11:00:02.746Z ## Functions diff --git a/api/utils/number.md b/api/utils/number.md index d2edc42..90024e8 100644 --- a/api/utils/number.md +++ b/api/utils/number.md @@ -6,7 +6,7 @@ # utils/number -> Last updated 2024-11-18T09:12:16.698Z +> Last updated 2024-11-18T11:00:02.746Z ## Functions diff --git a/api/utils/position.md b/api/utils/position.md index ae040a0..138413f 100644 --- a/api/utils/position.md +++ b/api/utils/position.md @@ -6,7 +6,7 @@ # utils/position -> Last updated 2024-11-18T09:12:16.698Z +> Last updated 2024-11-18T11:00:02.746Z ## Functions diff --git a/api/utils/remove-speccer-element.md b/api/utils/remove-speccer-element.md index ce5eab0..b8e0807 100644 --- a/api/utils/remove-speccer-element.md +++ b/api/utils/remove-speccer-element.md @@ -6,7 +6,7 @@ # utils/remove-speccer-element -> Last updated 2024-11-18T09:12:16.699Z +> Last updated 2024-11-18T11:00:02.747Z ## Functions diff --git a/api/utils/resize.md b/api/utils/resize.md index c563c45..175e0cf 100644 --- a/api/utils/resize.md +++ b/api/utils/resize.md @@ -6,7 +6,7 @@ # utils/resize -> Last updated 2024-11-18T09:12:16.699Z +> Last updated 2024-11-18T11:00:02.747Z ## Functions diff --git a/api/utils/style-property.md b/api/utils/style-property.md index 7850d6a..fd061f4 100644 --- a/api/utils/style-property.md +++ b/api/utils/style-property.md @@ -6,7 +6,7 @@ # utils/style-property -> Last updated 2024-11-18T09:12:16.699Z +> Last updated 2024-11-18T11:00:02.747Z ## Functions diff --git a/api/utils/styles.md b/api/utils/styles.md index 73ba366..f109a15 100644 --- a/api/utils/styles.md +++ b/api/utils/styles.md @@ -6,7 +6,7 @@ # utils/styles -> Last updated 2024-11-18T09:12:16.699Z +> Last updated 2024-11-18T11:00:02.748Z ## Functions diff --git a/api/utils/typeof.md b/api/utils/typeof.md index 6da4df9..b7d24b1 100644 --- a/api/utils/typeof.md +++ b/api/utils/typeof.md @@ -6,7 +6,7 @@ # utils/typeof -> Last updated 2024-11-18T09:12:16.700Z +> Last updated 2024-11-18T11:00:02.748Z ## Functions diff --git a/api/utils/wait.md b/api/utils/wait.md index f0e7a7b..aa4ed76 100644 --- a/api/utils/wait.md +++ b/api/utils/wait.md @@ -6,7 +6,7 @@ # utils/wait -> Last updated 2024-11-18T09:12:16.700Z +> Last updated 2024-11-18T11:00:02.749Z ## Functions diff --git a/api/utils/xy.md b/api/utils/xy.md index e7464ac..f311a81 100644 --- a/api/utils/xy.md +++ b/api/utils/xy.md @@ -6,7 +6,7 @@ # utils/xy -> Last updated 2024-11-18T09:12:16.701Z +> Last updated 2024-11-18T11:00:02.749Z ## Variables diff --git a/dev/spacing.html b/dev/spacing.html index 1b997ca..072fe2d 100644 --- a/dev/spacing.html +++ b/dev/spacing.html @@ -26,6 +26,12 @@ rel="stylesheet" type="text/css" /> + Spacing --> +
+
+
+

Settings

+
+ + +
+
+ + +
+
+ Flip + + + + + + + Rotate + + + + + + + +
+
+

View settings

+
+ + +
+
+
+ + +
+ +
+ + +
+ +
+ + +
+
+
+ + +
+
+ + +
+
+ +
+
+
str.trim()); const _shortcut_holder = document.createElement('div'); - const _shortcut_holder_class_names = cx('ph-speccer speccer a11y shortcut-holder'); + const _shortcut_holder_class_names = cx( + 'ph-speccer speccer a11y shortcut-holder' + ); setClassNames(_shortcut_holder, _shortcut_holder_class_names); diff --git a/src/features/grid/index.ts b/src/features/grid/index.ts index 8253eed..32f31fc 100644 --- a/src/features/grid/index.ts +++ b/src/features/grid/index.ts @@ -94,8 +94,10 @@ export const create = async ( gridColumnContainer.setAttribute('data-speccer-id', _pin_element_id); - - setClassNames(gridColumnContainer, 'ph-speccer speccer speccer-grid-container'); + setClassNames( + gridColumnContainer, + 'ph-speccer speccer speccer-grid-container' + ); addStyles(gridColumnContainer, { height: `${height + 64}px`, @@ -137,15 +139,18 @@ export const create = async ( gridRowContainer.classList.add('speccer'); gridRowContainer.classList.add('speccer-grid-row-container'); - setClassNames(gridRowContainer, 'ph-speccer speccer speccer-grid-row-container'); + setClassNames( + gridRowContainer, + 'ph-speccer speccer speccer-grid-row-container' + ); addStyles(gridRowContainer, { - width: `${width + 64}px`, - height: `${height}px`, - top: `${top}px`, - left: `${left - 32}px`, - padding: padding, - gridTemplateRows: gridTemplateRows + width: `${width + 64}px`, + height: `${height}px`, + top: `${top}px`, + left: `${left - 32}px`, + padding: padding, + gridTemplateRows: gridTemplateRows }); const numberOfRowItems = gridTemplateRows.split(' ').length; diff --git a/src/features/spacing/utils/__tests__/position.ts b/src/features/spacing/utils/__tests__/position.ts index e61af0e..3cff80b 100644 --- a/src/features/spacing/utils/__tests__/position.ts +++ b/src/features/spacing/utils/__tests__/position.ts @@ -8,8 +8,10 @@ import { position } from '../position'; describe('position', () => { test('position should correctly calculate properties for marginTop', async () => { - // Set up JSDOM environment - const { window } = new JSDOM('
'); + // Set up JSDOM environment + const { window } = new JSDOM( + '
' + ); const document = window.document; const targetElement = document.getElementById('target'); @@ -23,7 +25,6 @@ describe('position', () => { bottom: 70 }); - const result = await position('marginTop', 20, targetElement); assert.deepEqual(result, { @@ -35,7 +36,9 @@ describe('position', () => { }); test('position should correctly calculate properties for marginRight', async () => { - const { window } = new JSDOM('
'); + const { window } = new JSDOM( + '
' + ); const document = window.document; const targetElement = document.getElementById('target'); @@ -48,8 +51,6 @@ describe('position', () => { bottom: 70 }); - - const result = await position('marginRight', 20, targetElement); assert.deepEqual(result, { @@ -61,7 +62,9 @@ describe('position', () => { }); test('position should correctly calculate properties for marginBottom with options', async () => { - const { window } = new JSDOM('
'); + const { window } = new JSDOM( + '
' + ); const document = window.document; const targetElement = document.getElementById('target'); @@ -74,9 +77,9 @@ describe('position', () => { bottom: 70 }); - - - const result = await position('marginBottom', 30, targetElement, { spacing: { bound: true } } as unknown as SpeccerOptionsInterface); + const result = await position('marginBottom', 30, targetElement, { + spacing: { bound: true } + } as unknown as SpeccerOptionsInterface); assert.deepEqual(result, { height: '30px', @@ -87,7 +90,9 @@ describe('position', () => { }); test('position should return undefined for unsupported properties', async () => { - const { window } = new JSDOM('
'); + const { window } = new JSDOM( + '
' + ); const document = window.document; const targetElement = document.getElementById('target'); @@ -100,15 +105,15 @@ describe('position', () => { bottom: 70 }); - - const result = await position('unsupportedProperty', 20, targetElement); assert.equal(result, undefined); }); test('position should correctly calculate properties for marginLeft', async () => { - const { window } = new JSDOM('
'); + const { window } = new JSDOM( + '
' + ); const document = window.document; const targetElement = document.getElementById('target'); @@ -121,7 +126,6 @@ describe('position', () => { bottom: 70 }); - const result = await position('marginLeft', 20, targetElement); assert.deepEqual(result, { @@ -133,7 +137,9 @@ describe('position', () => { }); test('position should correctly calculate properties for paddingTop', async () => { - const { window } = new JSDOM('
'); + const { window } = new JSDOM( + '
' + ); const document = window.document; const targetElement = document.getElementById('target'); @@ -146,7 +152,6 @@ describe('position', () => { bottom: 70 }); - const result = await position('paddingTop', 30, targetElement); assert.deepEqual(result, { @@ -158,7 +163,9 @@ describe('position', () => { }); test('position should correctly calculate properties for paddingBottom with options', async () => { - const { window } = new JSDOM('
'); + const { window } = new JSDOM( + '
' + ); const document = window.document; const targetElement = document.getElementById('target'); @@ -171,8 +178,9 @@ describe('position', () => { bottom: 70 }); - - const result = await position('paddingBottom', 30, targetElement, { spacing: { bound: true } } as unknown as SpeccerOptionsInterface); + const result = await position('paddingBottom', 30, targetElement, { + spacing: { bound: true } + } as unknown as SpeccerOptionsInterface); assert.deepEqual(result, { height: '30px', @@ -183,7 +191,9 @@ describe('position', () => { }); test('position should correctly calculate properties for paddingRight', async () => { - const { window } = new JSDOM('
'); + const { window } = new JSDOM( + '
' + ); const document = window.document; const targetElement = document.getElementById('target'); @@ -196,7 +206,6 @@ describe('position', () => { bottom: 70 }); - const result = await position('paddingRight', 40, targetElement); assert.deepEqual(result, { @@ -208,7 +217,9 @@ describe('position', () => { }); test('position should correctly calculate properties for paddingLeft', async () => { - const { window } = new JSDOM('
'); + const { window } = new JSDOM( + '
' + ); const document = window.document; const targetElement = document.getElementById('target'); @@ -221,7 +232,6 @@ describe('position', () => { bottom: 70 }); - const result = await position('paddingLeft', 40, targetElement); assert.deepEqual(result, { @@ -233,7 +243,9 @@ describe('position', () => { }); test('position should correctly handle bound spacing option', async () => { - const { window } = new JSDOM('
'); + const { window } = new JSDOM( + '
' + ); const document = window.document; const targetElement = document.getElementById('target'); @@ -246,8 +258,9 @@ describe('position', () => { bottom: 70 }); - - const result = await position('paddingTop', 30, targetElement, { spacing: { bound: true } } as unknown as SpeccerOptionsInterface); + const result = await position('paddingTop', 30, targetElement, { + spacing: { bound: true } + } as unknown as SpeccerOptionsInterface); assert.deepEqual(result, { height: '30px', diff --git a/src/features/spacing/utils/position.ts b/src/features/spacing/utils/position.ts index 7ece063..ee4eff4 100644 --- a/src/features/spacing/utils/position.ts +++ b/src/features/spacing/utils/position.ts @@ -23,7 +23,7 @@ export const position = async ( value: number, targetElement: HTMLElement, options?: SpeccerOptionsInterface | undefined -): Promise => { +): Promise => { await waitForFrame(); const _target_rect = targetElement.getBoundingClientRect(); diff --git a/src/main.ts b/src/main.ts index 856cab6..77ef605 100644 --- a/src/main.ts +++ b/src/main.ts @@ -91,7 +91,7 @@ const speccer = () => { removeAll('.ph-speccer.speccer'); const spacingElements = document.querySelectorAll( - `[${SPECCER_DATA_ATTRIBUTE}^="${SPECCER_FEATURE_SPACING}"],[${SPECCER_DATA_ATTRIBUTE}^="${SPECCER_FEATURE_SPACING}"] *:not(td):not(tr):not(th):not(tfoot):not(thead):not(tbody)` + `[${SPECCER_DATA_ATTRIBUTE}^="${SPECCER_FEATURE_SPACING}"]` ); const measureElements = document.querySelectorAll( `[${SPECCER_DATA_ATTRIBUTE}^="${SPECCER_FEATURE_MEASURE}"]` @@ -117,6 +117,20 @@ const speccer = () => { } for (const el of spacingElements) { spacingElement(el as HTMLElement); + + if (el.hasChildNodes()) { + const _child_spacing_elements = el.querySelectorAll( + '*:not(td):not(tr):not(th):not(tfoot):not(thead):not(tbody):not([data-speccer])' + ); + const _areas_string: string = el.getAttribute('data-speccer') || ''; + + if (_child_spacing_elements && _child_spacing_elements.length) { + for (const childEl of _child_spacing_elements) { + childEl.setAttribute('data-speccer', _areas_string); + spacingElement(childEl as HTMLElement); + } + } + } } for (const el of measureElements) { measureElement(el as HTMLElement); diff --git a/src/utils/styles.ts b/src/utils/styles.ts index 8dd234a..1bab620 100644 --- a/src/utils/styles.ts +++ b/src/utils/styles.ts @@ -40,7 +40,7 @@ export const add = async ( await waitForFrame(); - if (Array.isArray(styles)){ + if (Array.isArray(styles)) { styles = styles.reduce((acc, st) => { acc[st.key] = st.value;