Article provides styles to common element selectors to create an article in a content page.
Article can be used on any content page that displays large blocks of text-driven information. It's meant to be used as a standalone element and should not be nested inside any other components that may change the background color from the anticipated one. In the event that you must nest an article inside another component, please ensure that you set the article's background color to the default body color.
Meta is used if there is metadata information about your article (i.e. author name, date, etc). Meta is a custom directive of article and is not a native element selector. To use it, add daffArticleMeta
to a paragraph (<p>
).
The link style in an article uses the default browser link style.
These are styles for inline and multiline blocks of code.
Articles also support other custom "non-native" components like accordions, media galleries, and lists. Unlike typical HTML (<p>
, <ol>
, <ul>
, etc) content, these components must be style encaspulated to prevent article styles bleeding down from the article into their content. Many Daffodil components support this out of the box. If you have a custom component that you would like to place inside an article, you can use the DaffArticleEncapsulatedDirective
on your component to prevent article styles bleeding into your component.
To use article in a standalone component, import it directly into your custom component:
@Component({
selector: 'custom-component',
templateUrl: './custom-component.component.html',
standalone: true,
imports: [
DAFF_ARTICLE_COMPONENTS,
],
})
export class CustomComponent {}
To use article in a module, import DaffArticleModule
into your custom module:
import { NgModule } from '@angular/core';
import { DaffArticleModule } from '@daffodil/design/article';
@NgModule({
declarations: [
CustomComponent,
],
exports: [
CustomComponent,
],
imports: [
DaffArticleModule,
],
})
export class CustomComponentModule { }
This method is deprecated. It's recommended to update all custom components to standalone.