Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
popper-max-size-modifier
Advanced tools
A Popper.js modifier to change the size of your popper to fit it within the available viewport space.
Readme
A Popper.js modifier to change the size of your popper to fit it within the available viewport space.
# With npm
npm i popper-max-size-modifier
# With Yarn
yarn add popper-max-size-modifier
https://codesandbox.io/s/great-tesla-3roz7
import {createPopper} from '@popperjs/core';
import maxSize from 'popper-max-size-modifier';
// Create your own apply modifier that adds the styles to the state
const applyMaxSize = {
name: 'applyMaxSize',
enabled: true,
phase: 'beforeWrite',
requires: ['maxSize'],
fn({state}) {
// The `maxSize` modifier provides this data
const {width, height} = state.modifiersData.maxSize;
state.styles.popper = {
...state.styles.popper,
maxWidth: `${width}px`,
maxHeight: `${height}px`
};
}
};
createPopper(reference, popper, {
modifiers: [maxSize, applyMaxSize]
});
Sometimes you may want the flip
modifier to take precedence in cases where the
maxSize
modifier will make the popper too small (e.g. a minimum acceptable
size):
// Minimum acceptable size is 100px
`${Math.max(100, width)}px`;
`${Math.max(100, height)}px`;
All
detectOverflow
options
can be passed.
createPopper(reference, popper, {
modifiers: [
{
...maxSize,
options: {
boundary: customBoundaryElement,
padding: 20
}
},
applyMaxSize
]
});
The source is located in the root package at
src/modifiers/maxSize.js
.
FAQs
A Popper.js modifier to change the size of your popper to fit it within the available viewport space.
The npm package popper-max-size-modifier receives a total of 74,633 weekly downloads. As such, popper-max-size-modifier popularity was classified as popular.
We found that popper-max-size-modifier demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.