@fictivekin/fk-sass

中文文档
1.0.7发布于 2021/11/05MITCommonJS零依赖近 30 天下载 3409

Fictive Kin starter sass framework

原始使用文档
文档目录7 节
  1. usage
  2. Download and copy
  3. Through NPM
  4. Things to know
  5. Assets
  6. Configuration and Custom Properties
  7. Grid

fk-sass

Fictive Kin starter Sass package.

usage

There are two ways to use fk-sass. 1) Through npm, where project specific styles extend the base package or 2) download and copy directly to your project.

Download and copy

Download this repo and copy the scss directory into your project. Your sass compile step should include that directory as a load-path so that the @use and @forward statements work as expected.

And example compile script would look like:

sass scss:css --source-map --load-path=scss

Through NPM

Run the following in your project directory to install:

yarn add @fictivekin/fk-sass --dev

Copy the example-project directory from this repo into your project where sass files will live.

Add this new directory and the node_modules fk-sass directory to your sass compile script. Here is an example compile script:

sass scss:css --source-map --load-path=scss --load-path=node_modules/@fictivekin/fk-sass/scss

With this setup, the project sass files are setup to either overwrite the fk-sass files, fall-back to the fk-sass files, or be a supplement to the fk-sass files.

This allows you to create prooject specific styles without altering the base package.

Note that there are examples of how this plays out practically in the example-project directory. Several modules have _settings.scss files that are intended to give you control over the look of modules without having to rewrite or copy the base styles.

Things to know

Assets

There is a css url helper available. Add it for use in your sass partial with:

@use 'lib/assets';

or

@use 'lib/assets' as *;

It is also included in the config collection, which you can use with:

@use 'config' as *;

config/_assets.scss has a good example of how http-url, font-url, and image-url are used. This file also lets you set where these asset directories are located. Remember: create a config/_assets.scss file in your project sass files to overwrite the directories that are set in the base package.

Buildstamps can also be an important part of asset linking. To utilize this, your build/deploy process should add a _buildstamp.scss file in your sass directory where a $BUILDSTAMP variable is set (to whatever naming convention you use for this purpose).

Configuration and Custom Properties

The config and _1_base/properties directories seem to accomplish similar tasks — they both contain files that control settings that can affect a lot of your project.

All files in the number folders — _1_base, _2_layout, etc. — write out actual CSS styles. All files in config and lib do not write out CSS, and are designed for use as helpers in other files.

This is why custom properties are set in _1_base, but sass variables are set in config. You'll want to visit both sets of files to prepare your project's setup.

Grid

At this time, there is no all-encompasing grid system included with fk-sass. The growing prevelence of CSS grid means it is often simpler (with less unused CSS) to define the grid within specific modules where it is used.

This is something we'll evaluate with use.

版本与发布记录

@fictivekin/fk-sass 共发布 7 个版本,首次发布于 2020/11/06;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.0.7latest2021/11/055 年前
1.0.62021/11/055 年前
1.0.52021/08/245 年前
1.0.32021/04/015 年前
1.0.22020/12/045 年前
1.0.12020/11/066 年前

关于 @fictivekin/fk-sass 的常见问题

@fictivekin/fk-sass 是什么?

Fictive Kin starter sass framework

如何安装 @fictivekin/fk-sass?

在项目目录运行 npm install @fictivekin/fk-sass,或使用 pnpm add / yarn add / bun add。

@fictivekin/fk-sass 支持 TypeScript 吗?

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

@fictivekin/fk-sass 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@fictivekin/fk-sass 可以商用吗?

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

@fictivekin/fk-sass 的下载量有多少?

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

@fictivekin/fk-sass 还在维护吗?

最新版本 1.0.7 发布于 2021/11/05(5 年前);至今共发布 7 个版本,其中过去 12 个月发布了 0 个;首次发布于 2020/11/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。