承接 iastate/frontend-component-library 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

iastate/frontend-component-library

Composer 安装命令:

composer require iastate/frontend-component-library

包简介

Frontend component library for Iowa State University.

README 文档

README

This is a frontent library designed and built for use in Iowa State University web projects.

Installation of this library into your projects

Installing via composer

Whenever possible, we reccomend using composer to install this library, to ensure all future updates can be pulled in to your project.

composer require iastate/frontend-component-library

Using the library

In general, to use this library in your own project, you would need to link the CSS/JS files from the build folder:

  • Link to /build/css/index.css
  • Link to /build/css/print.css (print syles only)
  • Link to /build/js/index.js

You can then pull, and utilize the provided markup examples in your own project.

Development

This library is designed to be used "as-is" for most developers. If you wish to modify this library, you will need to create your own fork. This section is strictly information for those working on, and committing to, this project.

The component library includes Fractal for component based development. Your own components can be added to the src/components folder. Static assets such as JavaScript, CSS and images will be served out of the build folder, but can also be configured to your specific needs by editing the fractal.js file. For more information, read the fractal guide.

General notes:

  • Installed Boostrap 5.1, the site uses the default breakpoints
  • Using Iowa State color variables
  • Using Iowa State Font Awesome for social media icons and various elements
  • All CSS/JS is scoped to not interfere with Boostrap, using a prefix of "iastate22-" on relevant classes
  • All components live in the src/components directory
  • The page structure can be found in src/components/_page-preview.twig. For individual components, the structure is located in src/components/_preview.twig

Dependencies

Dependencies need to be installed with node/npm, and is best pinned to stable versions via nvm. More on node usage at idfive.

  • cd idfive-component-library
  • nvm use
  • npm install

Building for development

To start the fractal development server:

  • cd idfive-component-library
  • nvm use
  • npm run fractal

Building for production

To build your code for production, prior to a release, run the following:

  • npm run build
  • npm run fractal:build

This will generate build and fractal folders at the root of your project. The build folder contains all of your compiled assets (CSS, JavaScript etc.), while the fractal folder contains a static generated version of your Fractal component library, which can be used for previews and an online reference to your component library. The build folder is committed, in order that projects may use it as a dependency directly.

Versioning

Releases for this project should follow Semantic Versioning.

Steps when releasing:

  • Commit (or merge) and push master to origin.
  • Tag 1.0.1 (the new release version), and push to origin. The tag is what composer uses to define a new release.

Markup

  • Written using Twig templates
  • Proper ARIA functionality is used to meet WCAG accessibility guidelines

Page wrapper and overall structure

This structure below shows the overall wrappers and ordering needed to properly display the layout:

<body>
  <a class="skip-link" href="#main-content">Skip To Main Content</a>
  <div class="off-canvas">
    <div class="max-bound">
      {% include "@site-header" with header %}
      <main id="main-content">
        {{ yield }}
      </main>
      {% include "@site-footer" with footer %}
    </div>
  </div>
  <!-- Scripts Here -->
</body>
  • The .skip-link link is provided for accessibility purposes
  • The .off-canvas div is in use to set overflow-x: hidden; on the whole page to prevent unwanted horizontal scrolling
  • Next is the .max-bound div, which provides a max-width, (and 100% width), centers the content and provides a background-color the the whole document
  • Next our main site header is added {% include "@site-header" with header %}
  • Then the <main id="main-content"> is added which contains all of the page content {{ yield }}
  • After the closing <main> tag, the footer is added {% include "@site-footer" with footer %}
  • Kitchen sink pages have an additional tag <div class="outer-pad"> directly after <main>, which provides left and right padding for the page

Images

All images should be added to src/images which compiles to build/images/*.

CSS/JS

  • All CSS/JS/Images will be compiled from src/*.
  • All CSS to be written as SCSS, and compiled via Webpack.
  • All CSS compiled from src/scss/index.scss
  • All theme JS is written as TypeScript, and compiled to stable, browser-compliant JS via Webpack.
  • ALL JS to be compiled from Typescript in src/js/index.ts

Utility Classes

  • In _base.scss, .align-left, .align-right, and .align-center handle images placed in WYSIWYG sections
  • In _base.scss, the .skip-link class is for the "Skip To Main Content" button for accessibility
  • In _placeholder-selectors.scss, .visible-for-screen-readers is used to hide content but allow it to be accessibly read/spoken
  • In _placeholder-selectors.scss, .outer-pad-x handles horiztonal padding throughout various parts of the site
  • In _placeholder-selectors.scss, %responsive-img is a placeholder selector which sets up object-fit for images and the padding-top percentage for the associated pseudo element which sets the height of the image
  • In _placeholder-selectors.scss, .caption is a re-used type style for image and video captions
  • In _placeholder-selectors.scss, .arrow is the arrow shape used throughout various button and nav styles
  • In _base.scss, there are two helper classes for remove the space above and below paragraph widgets. .paragraph-widget-no-margin-bottom will reduce the margin-bottom of the widget to zero and .paragraph-widget-no-margin-top will reduce the margin-top top zero. These both have !important tags attached to ensure there are no conflicts.

Acceptance Standards

  • W3C Validation
  • Passes Accessibility check using WAVE and Google Lighthouse
  • Provides fallback of full content for non-JS users.

iastate/frontend-component-library 适用场景与选型建议

iastate/frontend-component-library 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 653 次下载、GitHub Stars 达 5, 最近一次更新时间为 2022 年 09 月 26 日, 在 PHP 生态内属于活跃度较高的组件。

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

围绕 iastate/frontend-component-library 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 653
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 13
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 6
  • Forks: 3
  • 开发语言: JavaScript

其他信息

  • 授权协议: Unknown
  • 更新时间: 2022-09-26