Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
aug-attr-spliced
Advanced tools
augmented-ui plugin: adds the augmented-ui attribute to elements automatically from CSS
augmented-ui plugin: adds the augmented-ui
attribute to html elements automatically from CSS
assumes you're using augmented-ui already
npm install aug-attr-spliced
import "aug-attr-spliced"
or
<script type="module">
import "https://unpkg.com/aug-attr-spliced/aug-attr-spliced.js"
</script>
Allows you to specify augmentations for an element (or several; whatever matches the selector) from the CSS itself with the --augmented-ui
custom property:
.logo-augmented-ui {
--augmented-ui: tr-clip r-notch-y br-round bl-clip exe;
--aug-border: 20px;
--aug-border-bg: black;
--aug-tr: 40px;
--aug-bl: 60px;
--aug-br: 30px;
--aug-r-width: 20px;
--aug-r-height: 200px;
}
.un-logo,
.logo-augmented-ui:hover {
--augmented-ui: bl-clip r-notch-x exe;
--aug-r-width: 60px;
}
.logo-augmented-ui {
box-sizing:border-box;background:#ffd700;width:400px;height:400px;padding-top:120px;padding-left:40px;font-family:sans-serif;font-size:100px;font-weight:bold;text-align:left;
}
<div class="logo-augmented-ui">
<aug>
</div>
<button onclick="this.previousElementSibling.classList.add('un-logo')">update class</button>
On page load, the .logo-augmented-ui
element will be updated automatically:
el.setAttribute("augmented-ui", " tr-clip r-notch-y br-round bl-clip exe")
On hover of the element, aug-attr-spliced will automatically update the augmentations from the :hover rule:
el.setAttribute("augmented-ui", " bl-clip r-notch-x exe")
And when you stop hovering (mouseleave), it will update again, setting the html el attribute accordingly.
When the button is clicked, the "un-logo" class name is added to the logo. This change is automatically detected and the attribute is again updated to the expected rule.
Mouseenter and mouseleave from that point will keep updating it, but the last rule applied is always un-logo
so the cascaded result is no change.
Add the attribute data-attr-spliced-ignore
to parent containers of elements that you expect will change frequently to avoid heavy repeat cascading checks and application.
(unless you need css to update the augs within)
This is especially important to add to javascript animations because every change is observed and the cascade has to recalculate in case something changes the a rule with the --augmented-ui
property.
:hover
pseudo class is supportedFAQs
augmented-ui plugin: adds the augmented-ui attribute to elements automatically from CSS
The npm package aug-attr-spliced receives a total of 0 weekly downloads. As such, aug-attr-spliced popularity was classified as not popular.
We found that aug-attr-spliced 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.