Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@rei/cdr-text
Advanced tools
For the most up-to-date information, see headings and paragraphs in REI Cedar Docs.
tag | string | 'p' |
---|---|---|
name | type | default |
Sets valid HTML element tag
modifier | string | N/A |
---|---|---|
name | type | default |
Modifies the style variant for this component. Possible values: { ‘body’ | ‘display’ | ‘display-static’ | ‘heading-large’ | ‘heading-large-static’ | ‘heading-medium’ | ‘heading-medium-static’ | ‘heading-small’ | ‘heading-small-static’ | ‘subheading' }
default |
---|
name |
Set the innerHTML for cdr-text. This includes text and html markup. |
Resources are available within the cdr-text package:
Name | Type | Description |
---|---|---|
@rei/cdr-text | Node module package | Import the component into your project |
To incorporate the required assets for a component, use the following steps:
Install the cdrText
package using npm
in your terminal:
Terminal
npm i -s @rei/cdr-text
main.js
// import your required css.
import "@rei/cdr-assets/dist/cdr-core.css";
import "@rei/cdr-assets/dist/cdr-fonts.css";
local.vue
<template>
<cdr-text
modifier="body"
>
For long-form content like expert advice articles or co-op journal entries.
</cdr-text>
</template>
<script>
import { CdrText } from '@rei/cdr-text';
export default {
...
components: {
CdrText
}
}
</script>
The CdrText component allows for styling any html element with available text styles. Visual style and semantic meaning are managed independently by providing:
tag
propmodifier
propThis method decouples the semantic meaning of a heading level from the visual representation.
With this decoupling, you can style other markup to look like a heading that semantically isn’t a heading. For example, you can style an <a>
tag in a multi-level navigation as a heading.
<cdr-text
tag="a"
modifier="heading-small"
href="http://www.rei.com">
Heading-large linked
</cdr-text>
This will result in the following HTML:
<cdr-text modifier="body">
<a class=”heading-small” href=”http://www.rei.com”>Heading-small linked</a>
</cdr-text>
CdrText modifiers can be nested within semantic headings. The below modifier for subheading is nested in the <h2>
tag.
<cdr-text
tag="h2"
modifier="heading-large">
I'm a heading
<cdr-text
tag="span"
modifier="subheading"
>
And I'm a visual subheading
</cdr-text>
</cdr-text>
This will result in the following HTML:
<h2>
I’m a heading
<span class=”subheading”>
And I’m a visual subheading
</span>
</h2>
<cdr-text
tag="em"
modifier="heading-medium-static">
I should not change size at breakpoint
</cdr-text>
When using actual heading elements via the tag property, nest headings by their level:
<h1>
) and the least important heading level 6 (<h6>
)Skipping heading levels can be confusing and should be avoided where possible:
<h2>
tag by an <h4>
tag<h4>
tag closes a previous section, follow with a <h2>
tag to open the next sectionIn fixed sections of the page (e.g. sidebars), heading levels should not change depending on the heading levels in other areas of the page. Consistency across pages is required throughout the REI digital properties as explained on the Navigation Design Principles Confluence page.
By default the cdrText component renders as a paragraph, this default paragraph is intended for most standard use cases.
<cdr-text>
This is a standard paragraph, intended for non long form copy usage.
</cdr-text>
When rendering long form copy add the body
modifier.
<cdr-text modifier="body">
This paragraph is intended for long form copy usage.
</cdr-text>
Define custom tags by applying a specific cdr-text
style with modifiers to it.
<cdr-text
tag="span"
modifier="body">
This span now renders as a long form copy paragraph that displays inline.
</cdr-text>
FAQs
REI Cedar Style Framework - Vue Component for Text
We found that @rei/cdr-text demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.