
Product
Announcing Socket Certified Patches: One-Click Fixes for Vulnerable Dependencies
A safer, faster way to eliminate vulnerabilities without updating dependencies
@aurodesignsystem/auro-background
Advanced tools
The auro-background element is an easy-to-use mobile-first alternative to writing custom CSS for background colors or images with automatically scoped media queries. Use independently or in the slot of another custom element such as auro-banner.
For the most up to date information on UI development browser support
$ npm i @aurodesignsystem/auro-background
The use of any Auro custom element has a dependency on the Auro Design Tokens.
Defining the component dependency within each component that is using the <auro-background> component.
import "@aurodesignsystem/auro-background";
Reference component in HTML
<auro-background bg="url(https://images.contentstack.io/v3/assets/blt2cefe12c88e9dd91/blt4dde4105498391f8/6633c2581dbb0973c00b8783/ad2.png) center center/cover no-repeat">
<div style="color: var(--ds-color-text-primary-inverse); display: flex; flex-direction: column; align-items: center; justify-content: center;">
<auro-header level="2" display="600">View all destinations</auro-header>
<auro-hyperlink cta href="#">See where we fly</auro-hyperlink>
</div>
</auro-background>
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-background@latest/+esm"></script>
The auro-background component accepts 4 properties - bg, height, width, and inset that serve as the default at all breakpoints. height, width, and inset are not required and sizing will scale to the content when omitted. Additionally, there is a separate property for each supported breakpoint (bgsm, bgmd, bglg, heightsm, heightmd, heightlg, widthsm, widthmd, widthlg). If you don't set specific size property the smaller property will be used.
These properties map to the compound CSS background property and CSS properties of height, width, and padding. Anything you can do within the scope of those CSS rules you can do here.
See CSS Background Image Generator for a helpful code generation tool.
<auro-background bg="url(https://images.contentstack.io/v3/assets/blt2cefe12c88e9dd91/blt4dde4105498391f8/6633c2581dbb0973c00b8783/ad2.png) center center/cover no-repeat">
<div style="color: var(--ds-color-text-primary-inverse); display: flex; flex-direction: column; align-items: center; justify-content: center;">
<auro-header level="2" display="600">View all destinations</auro-header>
<auro-hyperlink cta href="#">See where we fly</auro-hyperlink>
</div>
</auro-background>
In order to develop against this project, if you are not part of the core team, you will be required to fork the project prior to submitting a pull request.
Please be sure to review the contribution guidelines for this project. Please make sure to pay special attention to the conventional commits section of the document.
Once the project has been cloned to your local resource and you have installed all the dependencies you will need to open a shell session to run the dev server.
$ npm run dev
Open localhost:8000
Automated tests are required for every Auro component. See .\test\auro-background.test.js for the tests for this component. Run npm run test to run the tests and check code coverage. Tests must pass and meet a certain coverage threshold to commit. See the testing documentation for more details.
FAQs
auro-background HTML custom element
We found that @aurodesignsystem/auro-background demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers 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.

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.

Research
/Security News
Malicious npm packages use Adspect cloaking and fake CAPTCHAs to fingerprint visitors and redirect victims to crypto-themed scam sites.