定制 snowdog/module-alpaca-components 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

snowdog/module-alpaca-components

Composer 安装命令:

composer require snowdog/module-alpaca-components

包简介

Components of the Alpaca theme for Magento 2

README 文档

README

Greenkeeper badge Browser Status

⚠️ This project is deprecated. Please use Alpaca 2.0 instead.

Introduction

Components library of Alpaca design system created to speed up the process of working with design on Magento 2 stores, by creating each UI element, module, and view in a simplified, front-end developer friendly, environment.

This components liblary is built on top of Fractal.js.

Magento 2 experience isn't required to work with this code.

Demo / Preview

https://alpaca-components.now.sh/

Installation

  • Install dependencies using yarn
  • Run gulp dev to start Fractal.js development server
  • Run gulp if you want to generate static files (for example to deploy them)

How to create a components library on top of Alpaca

It's necessary only to work outside the Magento.

  1. Copy-paste package.json, gulpfile.js, .eslintignore, .eslintrc, .sass-lint.yml, .stylelintrc, .gitignore files to the new project
  2. Create modules.json file with an array of paths to parent components libraries. In most cases it will look like this:
    ["../../snowdog/module-alpaca-components"]
  3. Customize or add new files following the same structure as in Alpaca components library
  4. Run gulp dev

Directory structure

  • components directory is what you are going to import into the Magento 2 theme.
  • docs and public are just for the local environment purposes, you will find there sample images, testing libs, utility styles etc.

Core concepts

Components architecture

Components are divided into 4 groups:

  1. Globals
    • Contains code that other components can use in any place, for example, typography, icons or SASS variables.
  2. Elements
    • Smallest UI parts, for example, buttons
    • Element can't depend on other elements
    • Element shouldn't have any layout
  3. Modules
    • More complex UI parts like search form or header
    • Takes elements or modules and combine them together adding layout and context
  4. Views
    • Takes elements or modules and combine them together adding final layout and context
    • You should be able to show it to client/PM as a preview of ready to use store
    • You shouldn't create any new UI elements, everything needs to be reusable.

Naming

  • Group name needs to be plural
  • Component name needs to be singular
  • Component name shouldn't be related to any project or place in the layout
    • Bad: filters
    • Good: dropdown-list or collapsible-list
  • Avoid using box, block, item, info, text, cms, especialy combined together, for example info-box
  • Avoid naming two components in similar way i.e. cms-subcategories and cms-subcategory

Colors

  • By default alpaca components uses up to 7 step grayscale

SASS Variables naming

Follow BEM-like naming convention i.e. when you component name is button and you are creating a variable for a padding it should be $button__padding.

Same as in BEM, you are not allowed to build construction like $button__icon__padding, it should be $button__icon-padding.

Variables related to the pseudo-classes and pseudo-selectors should be treated as a BEM elements $button__color-hover.

Also, BEM modificators are allowed in variables $button__padding--secondary, you can even stack them like this $button__padding--secondary--dark.

To target variable to specific breakpoint adding \@breakpoint at the end of the variable name $button__padding\@medium. Always use small, medium, large etc. to describe the breakpoint.

Examples of proper variables names:

$swatch__option-border
$swatch__option-border-color-hover

$swatch__option-image-height\@large

$swatch__option-size--small
$swatch__option-image-width--small
$swatch__option-image-width--small\@large

Accessibility

You can run gulp a11y to run dev server with accessibility tests enabled.

If on some view there is no a11y message, please go to the component config and comment out preview: '@docs-only-styles'

snowdog/module-alpaca-components 适用场景与选型建议

snowdog/module-alpaca-components 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 83.27k 次下载、GitHub Stars 达 45, 最近一次更新时间为 2017 年 10 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 snowdog/module-alpaca-components 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 snowdog/module-alpaca-components 我们能提供哪些服务?
定制开发 / 二次开发

基于 snowdog/module-alpaca-components 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 83.27k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 45
  • 点击次数: 10
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 45
  • Watchers: 13
  • Forks: 10
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-09