Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mjml-head-attributes

Package Overview
Dependencies
Maintainers
6
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mjml-head-attributes

mjml-head-attributes

  • 5.0.0-alpha.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
596K
decreased by-8.05%
Maintainers
6
Weekly downloads
 
Created

What is mjml-head-attributes?

The mjml-head-attributes npm package is a part of the MJML framework, which is used to create responsive email templates. The mjml-head-attributes component allows you to define default attributes for MJML components within the <mj-head> section, making it easier to apply consistent styling across multiple components.

What are mjml-head-attributes's main functionalities?

Setting default attributes for MJML components

This feature allows you to set default attributes for MJML components like <mj-text> and <mj-button>. The provided code sample sets a default font size and color for <mj-text> components and a default background color for <mj-button> components.

<mjml>
  <mj-head>
    <mj-attributes>
      <mj-text font-size="20px" color="#000000" />
      <mj-button background-color="#ff0000" />
    </mj-attributes>
  </mj-head>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text>This text will have a font size of 20px and color #000000.</mj-text>
        <mj-button>This button will have a background color of #ff0000.</mj-button>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

Overriding default attributes

This feature allows you to override the default attributes set in the <mj-attributes> tag. The provided code sample shows how a specific <mj-text> component can have its own font size and color, different from the default values.

<mjml>
  <mj-head>
    <mj-attributes>
      <mj-text font-size="20px" color="#000000" />
    </mj-attributes>
  </mj-head>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text>This text will have a font size of 20px and color #000000.</mj-text>
        <mj-text font-size="25px" color="#ff0000">This text will override the default attributes and have a font size of 25px and color #ff0000.</mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

Other packages similar to mjml-head-attributes

FAQs

Package last updated on 05 Feb 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc