Skip to content
프로젝트

소개

BEM 코어 라이브러리

개발 도구

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

bem-core library CI GitHub Release

Documentation on bem-core is also available at bem.info. It is also available in Russian.

What is this?

bem-core is a base library for web interface development. It provides the minimal stack for coding client-side JavaScript and templating.

Use

Install as an npm dependency:

npm install bem-core@5

jQuery 4 is a peer dependency — install it alongside:

npm install jquery@^4.0.0

Inside

Levels

  • common.blocks — suited for any devices and browsers
  • desktop.blocks — should be used for desktop browsers
  • touch.blocks — implement some touch-platforms specifics

Blocks

  • i-bem — base block with helpers for JS and HTML
  • strings — helpers for JS-strings
  • objects — helpers for JS-objects
  • functions — helpers for JS-functions
  • events — JS-events
  • uri — helpers for work with URIs and querystrings
  • tick — global timer
  • idle — IDLE event
  • next-tick — polyfill for nextTick/setTimeout(0, ...)
  • inherit — OOP helpers
  • jquery — jQuery
  • clearfix — CSS clearfix trick
  • identify — identify JS-objects
  • cookie — helpers for work with browser cookies
  • dom — helpers for work with DOM
  • loader — loader for JS files
  • ua — browser features detection
  • keyboard — keyboard helpers
  • page — html/head/body scaffold

Technologies

  • vanilla.js + browser.js
  • bemhtml
  • bemtree

API

The autogenerated JSDoc API can be found on bem.info. E.g. JSDoc for i-bem is here https://en.bem.info/platform/libs/bem-core/current/desktop/i-bem/#jsdoc

Changelog

See CHANGELOG.md.

Migration

If you are upgrading from v4, see MIGRATION.md.

Development

Working copy

  1. Get the source code:

    git clone -b v5 git://github.com/bem/bem-core.git
    cd bem-core
    
  2. Install the dependencies (requires Node.js 20+):

    npm install
    
  3. Run linting:

    npm run lint
    
  4. Run tests:

    npm test              # server-side tests (node:test)
    npm run test:browser  # browser tests (Playwright)
    npm run test:all      # both
    
  5. Build:

    npm run build         # desktop + touch platforms
    

How to contribute

Please refer to How to contribute guide.

Supported browsers

  • Google Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

License

Code and documentation copyright 2012 YANDEX LLC. Code released under the Mozilla Public License 2.0.

관련 프로젝트 살펴보기

불러오는 중…