Gathering detailed insights and metrics for @advanced-rest-client/arc-fit-mixin
Gathering detailed insights and metrics for @advanced-rest-client/arc-fit-mixin
Gathering detailed insights and metrics for @advanced-rest-client/arc-fit-mixin
Gathering detailed insights and metrics for @advanced-rest-client/arc-fit-mixin
npm install @advanced-rest-client/arc-fit-mixin
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
43 Commits
1 Watching
3 Branches
3 Contributors
Updated on 28 Jan 2023
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-4.1%
328
Compared to previous day
Last week
-15.6%
1,415
Compared to previous week
Last month
-26.4%
5,994
Compared to previous month
Last year
-20%
87,432
Compared to previous year
Use the @anypoint-web-components/awc
module instead.
This mixin is a port of iron-fit-behavior that works with LitElement.
ArcFitMixin
fits an element in another element using max-height
and max-width
, and optionally centers it in the window or another element. The element will only be sized and/or positioned if it has not already been sized and/or positioned by CSS.
CSS properties | Action |
---|---|
position set | Element is not centered horizontally or vertically |
top or bottom set | Element is not vertically centered |
left or right set | Element is not horizontally centered |
max-height set | Element respects max-height |
max-width set | Element respects max-width |
ArcFitMixin
can position an element into another element using verticalAlign
and horizontalAlign
. This will override the element's css position.
1<div class="container"> 2 <arc-fit-impl verticalalign="top" horizontalalign="auto"> 3 Positioned into the container 4 </arc-fit-impl> 5</div>
Use noOverlap
to position the element around another element without overlapping it.
1<div class="container"> 2 <arc-fit-impl nooverlap verticalalign="auto" horizontalalign="auto"> 3 Positioned around the container 4 </arc-fit-impl> 5</div>
Use horizontalOffset, verticalOffset
to offset the element from its
positionTarget
; ArcFitMixin
will collapse these in order to
keep the element within fitInto
boundaries, while preserving the element's
CSS margin values.
1<div class="container"> 2 <arc-fit-impl verticalalign="top" verticaloffset="20"> 3 With vertical offset 4 </arc-fit-impl> 5</div>
The following attributes are supported for compatibility with older and Polymer elements but eventually will be removed and replaced wit the corresponding new attribute.
sizing-target
> sizingtarget
fit-into
> fitinto
no-overlap
> nooverlap
position-target
> positiontarget
horizontal-align
> horizontalalign
vertical-align
> verticalalign
dynamic-align
> dynamicalign
horizontal-offset
> horizontaloffset
vertical-offset
> verticaloffset
auto-fit-on-attach
> autofitonattach
1npm i @advanced-rest-client/arc-fit-mixin
1import { LitElement } from 'lit-element'; 2import { ArcFitMixin } from '@advanced-rest-client/arc-fit-mixin'; 3 4class ArcFitImpl extends ArcFitMixin(LitElement) { 5 static get properties() { 6 return { 7 myProp: { type: Object, attribute: 'my-prop' }, 8 }; 9 } 10}
1npm run test
1npm run test:sl
1npm start
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 1
Details
Reason
Found 1/25 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
project is archived
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
19 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More