stylex README

The project's README from github.com/facebook/stylex. As one markdown file: README.md.

StyleX · GitHub license npm version tests PRs Welcome

StyleX is a JavaScript library for defining styles for optimized user interfaces.

Documentation

Documentation Website

Documentation for individual packages can be found in their respective README files. Start with @stylexjs/stylex.

Example

Here is a simple example of StyleX use:

import * as stylex from '@stylexjs/stylex';

const styles = stylex.create({
  root: {
    padding: 10,
  },
  element: {
    backgroundColor: 'red',
  },
});

const styleProps = stylex.props(styles.root, styles.element);

Development

This is the development monorepo for StyleX.

Structure

Tasks

First, yarn install the yarn workspace.

Contributing

Development happens in the open on GitHub and we are grateful for contributions including bug fixes, improvements, and ideas.

Code of Conduct

This project expects all participants to adhere to Meta's OSS Code of Conduct. Please read the full text so that you can understand what actions will and will not be tolerated.

Contributing Guide

Read the contributing guide to learn about our development process, how to propose bug fixes and improvements, and how to build and test your changes.

Architectural Principles

Before proposing a change or addition to the StyleX API, you should familiarize yourself with the goals and architectural principles of the project.

License

StyleX is MIT licensed.

stylex (facebook/stylex)

Searching Database…

10.4K ·GitHub
Что это такое?StyleX — это система стилизации от Meta, JavaScript-библиотека для задания стилей оптимизированных пользовательских интерфейсов.
То есть стили я пишу на JavaScript вместо CSS-файлов?Да — стили описываются прямо в JavaScript-коде, а не в отдельных CSS-файлах; именно такой подход «стили в JS» и есть основа StyleX.
Как добавить его в проект?Установите пакет @stylexjs/stylex из npm — в README он указан как отправная точка — и дальше следуйте сайту с документацией.
Он работает через обычный тег script или нужен этап сборки?Нужен этап сборки: ваши стили компилируются Babel-плагином StyleX в рамках процесса сборки.
Мне придётся самому разбираться с интеграцией в сборку?Нет — в репозитории есть папка examples, где StyleX уже интегрирован с разными инструментами сборки, так что можно стартовать с готовой рабочей конфигурации.
Он подходит и для нативных мобильных приложений или только для веба?Он ориентирован на веб-интерфейсы: StyleX — это система стилей на основе CSS, встроенная в стандартную веб-сборку.
Что есть в репозитории, кроме самой библиотеки?Это монорепозиторий на yarn workspaces: помимо пакета stylex там есть плагины для PostCSS и Rollup, плагин ESLint, CLI, парсер значений стилей, документация и бенчмарки.
Creator
facebook
Size
18.5 MB
Stars
10.4K
Age
3y
Commits · 90 Days