@financial-times/o-quote

中文文档
5.3.4发布于 2023/10/27MITES Module零依赖近 30 天下载 1.2万

Styling for blockquotes, pull-quotes and any other types of quote

此软件包已被标记为弃用

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

原始使用文档
文档目录6 节
  1. Usage
  2. Markup
  3. Sass
  4. Migration Guide
  5. Contact
  6. Licence

o-quote MIT licensed

Styling for quotes

Usage

Check out how to include Origami components in your project to get started with o-quote.

Markup

A block quote is a passage of text from another source, or a passage of text that’s been spoken by a person. Used to attribute another source of information, or to quote the spoken words of a person.

For a standard blockquote style use classes o-quote o-quote--standard and the following markup. We recommend the editorial style instead for editorial contexts such as within articles.

<blockquote class="o-quote o-quote--standard">
    <p>
        The prize for this century’s worst technology product probably belongs to Google Glass, a pair of spectacles with an inbuilt camera and a tiny lens on which you could browse the internet. Suddenly you could film everybody you met, or silently ignore them and read Wikipedia.
    </p>
    <cite class="o-quote__cite">
        <span class="o-quote__author">Henry Mance</span>
        <span class="o-quote__source">Financial Times</span>
    </cite>
</blockquote>

For an editorial style blockquote swap the o-quote--standard class for o-quote--editorial. The editorial variant inherits font size and colour to support multiple editorial contexts. For example at the time of writing live blogs and article pages have different font sizes on large viewports but both should share the editorial quote style. Therefore the editorial quote must be within an element that sets typography styles such as o-editorial-typography-body.

-<blockquote class="o-quote o-quote--standard">
+<blockquote class="o-quote o-quote--editorial">
    <p>
        The prize for this century’s worst technology product probably belongs to Google Glass, a pair of spectacles with an inbuilt camera and a tiny lens on which you could browse the internet. Suddenly you could film everybody you met, or silently ignore them and read Wikipedia.
    </p>
    <cite class="o-quote__cite">
        <span class="o-quote__author">Henry Mance</span>
        <span class="o-quote__source">Financial Times</span>
    </cite>
</blockquote>

Sass

To output all o-quote styles include the oQuote mixin.

@import '@financial-times/o-quote/main';
@include oQuote();

Pass an options $opts map to include only the o-quote styles you need. For example o-quote has styles for standard and editorial blockquotes. To only include styles for the editorial blockquote:

@include oQuote($opts: (
    'standard': false, // do not output .o-quote--standard variant styles
    'editorial': true, // output .o-quote--editorial variant styles
    'cite': true // output .o-quote__cite styles, to support citations
));

The "editorial" option is only available to core brand users.

You may also use o-quote mixins with custom HTML markup. For example if your markup used my-blockquote as a classname. We do not recommend this approach unless you are unable to update your markup, as it may lead to unnecessary CSS output and more difficult migrations.

<blockquote class="my-blockquote">
    <p>The quote.</p>
    <cite class="my-blockquote__cite">
        <span class="my-blockquote__author">Author</span>
        <span class="my-blockquote__source">Source</span>
    </cite>
</blockquote>
.my-blockquote {
    @include oQuoteEditorial();
}

.my-blockquote .my-blockquote__cite {
    @include oQuoteEditorialCite();
}

.my-blockquote .my-blockquote__author {
    @include oQuoteEditorialCiteAuthor();
}

.my-blockquote .my-blockquote__source {
    @include oQuoteEditorialCiteSource();
}

The oQuoteEditorial mixins shown here are only available to core brand users. For a full list of o-quote mixins see o-quote SassDoc in the registry.

Migration Guide

StateMajor VersionLast Minor ReleaseMigration guide
✨ active5N/Amigrate to v5
⚠ maintained44.1migrate to v4
╳ broken33.0migrate to v3
╳ deprecated22.2migrate to v2
╳ deprecated11.3N/A

Contact

If you have any questions or comments about this component, or need help using it, please either raise an issue, visit #origami-support or email Origami Support.

Licence

This software is published under the MIT licence.

版本与发布记录

@financial-times/o-quote 共发布 27 个版本,首次发布于 2019/02/13;过去 12 个月发布了 0 个版本。

版本发布日期距今
5.3.4latest2023/10/273 年前
5.3.32023/08/253 年前
5.3.22023/04/283 年前
5.3.12022/12/213 年前
5.3.02022/02/084 年前
5.2.12022/01/134 年前

其他发布通道:prerelease → 5.0.0-beta.0。

关于 @financial-times/o-quote 的常见问题

@financial-times/o-quote 是什么?

Styling for blockquotes, pull-quotes and any other types of quote注意:该包已被作者标记为弃用——Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

如何安装 @financial-times/o-quote?

在项目目录运行 npm install @financial-times/o-quote,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@financial-times/o-icons(^7.0.0)、@financial-times/o-colors(^6.5.0)、@financial-times/o-spacing(^3.0.0)、@financial-times/o-typography(^7.4.1)、@financial-times/o-editorial-typography(^2.0.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@financial-times/o-quote 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/financial-times__o-quote 是否存在。

@financial-times/o-quote 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@financial-times/o-quote 可以商用吗?

@financial-times/o-quote 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@financial-times/o-quote 的下载量有多少?

根据 npm 官方下载统计,@financial-times/o-quote 在 2026/10/15 – 2026/11/13 这 30 天内被下载 11,782 次,日均约 393 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@financial-times/o-quote 还在维护吗?

最新版本 5.3.4 发布于 2023/10/27(3 年前);至今共发布 27 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/02/13。作者已将其标记为弃用,新项目建议寻找替代方案。