All Projects → fb55 → Css What

fb55 / Css What

Licence: bsd-2-clause
a CSS selector parser

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Css What

Mobile Select
手机移动端选择组件 支持是否级联/单选到多选/可异步更新数据等..
Stars: ✭ 829 (+518.66%)
Mutual labels:  selector
Postcss Prefix Selector
Prefix all CSS rules with a selector
Stars: ✭ 75 (-44.03%)
Mutual labels:  selector
Pd Select
vue components ,like ios 3D picker style,vue 3d 选择器组件,3D滚轮
Stars: ✭ 101 (-24.63%)
Mutual labels:  selector
Redux Tide
Simple library for redux crud normalized state and actions/selectors for it
Stars: ✭ 20 (-85.07%)
Mutual labels:  selector
Reapex
A lightweight framework to build pluggable and extendable redux/react application
Stars: ✭ 58 (-56.72%)
Mutual labels:  selector
Resq
React Element Selector Query (RESQ) - Query React components and children by component name or HTML selector
Stars: ✭ 89 (-33.58%)
Mutual labels:  selector
Dasel
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.
Stars: ✭ 759 (+466.42%)
Mutual labels:  selector
Dselectorbryant
单选滚动选择器、diy丰富、有阻尼效果、简单美观、触摸or点击模式 (Rolling Selector, Diy Rich, Damping Effect, Simple and Beautiful, Touch or Click Mode)
Stars: ✭ 109 (-18.66%)
Mutual labels:  selector
React Native Modal Dropdown
A react-native dropdown/picker/selector component for both Android & iOS.
Stars: ✭ 1,103 (+723.13%)
Mutual labels:  selector
Customalertviewdialogue
Custom AlertView Dialogue is the world's most advanced alert view library. Custom AlertView Dialogue includes simple message popups, confirmation alerts, selector popups, action sheet bottom menus, and input/feedback contact forms.
Stars: ✭ 100 (-25.37%)
Mutual labels:  selector
Rwidgethelper
Android UI 快速开发,专治原生控件各种不服
Stars: ✭ 996 (+643.28%)
Mutual labels:  selector
React Propers
Select react doms , and update props.
Stars: ✭ 40 (-70.15%)
Mutual labels:  selector
Xselectorutil
一个可以用代码处理控件的阴影效果,及用代码在TextView、EditText、Button等控件设置selector背景(触摸反馈,样式变化、文字颜色变化、hint文字颜色变化等效果)的组件
Stars: ✭ 98 (-26.87%)
Mutual labels:  selector
Iconswitch
🍭 Custom Android Switch widget
Stars: ✭ 874 (+552.24%)
Mutual labels:  selector
Dropdown
a lightweight dropdown of jQuery plugins
Stars: ✭ 105 (-21.64%)
Mutual labels:  selector
Domtastic
Small, fast, and modular DOM and event library for modern browsers.
Stars: ✭ 763 (+469.4%)
Mutual labels:  selector
Statebutton
一个可以用代码设置selector背景(按下去背景颜色更改,样式变化等等)的button, 再也不用写selector了
Stars: ✭ 1,276 (+852.24%)
Mutual labels:  selector
Actionclosurable
Extensions which helps to convert objc-style target/action to swifty closures
Stars: ✭ 120 (-10.45%)
Mutual labels:  selector
Mithril Query
Query mithril virtual dom for testing purposes
Stars: ✭ 105 (-21.64%)
Mutual labels:  selector
Lambda Converters
Strongly-typed lambda expressions as value converters, data template selectors, and validation rules
Stars: ✭ 99 (-26.12%)
Mutual labels:  selector

css-what Build Status

a CSS selector parser

Example

const CSSwhat = require("css-what")
CSSwhat.parse("foo[bar]:baz")

~> [
    [
        { type: "tag", name: "foo" },
        {
            type: "attribute",
            name: "bar",
            action: "exists",
            value: "",
            ignoreCase: false
        },
        { type: "pseudo", name: "baz", data: null }
    ]
]

API

CSSwhat.parse(selector, options) - Parses selector, optionally with the passed options.

The function returns a two-dimensional array. The first array represents selectors separated by commas (eg. sub1, sub2), the second contains the relevant tokens for that selector. Possible token types are:

name properties example output
tag name div { type: 'tag', name: 'div' }
universal - * { type: 'universal' }
pseudo name, data :name(data) { type: 'pseudo', name: 'name', data: 'data' }
pseudo name, data :name { type: 'pseudo', name: 'name', data: null }
pseudo-element name ::name { type: 'pseudo-element', name: 'name' }
attribute name, action, value, ignoreCase [attr] { type: 'attribute', name: 'attr', action: 'exists', value: '', ignoreCase: false }
attribute name, action, value, ignoreCase [attr=val] { type: 'attribute', name: 'attr', action: 'equals', value: 'val', ignoreCase: false }
attribute name, action, value, ignoreCase [attr^=val] { type: 'attribute', name: 'attr', action: 'start', value: 'val', ignoreCase: false }
attribute name, action, value, ignoreCase [attr$=val] { type: 'attribute', name: 'attr', action: 'end', value: 'val', ignoreCase: false }
child - > { type: 'child' }
parent - < { type: 'parent' }
sibling - ~ { type: 'sibling' }
adjacent - + { type: 'adjacent' }
descendant - { type: 'descendant' }

Options:

  • lowerCaseTags: When false, tag names will not be lowercased. Defaults to true.
  • lowerCaseAttributeNames: When false, attribute names will not be lowercased. Defaults to true.
  • xmlMode: When true, xmlMode implies both lowerCaseTags and lowerCaseAttributeNames are set to false.

CSSwhat.stringify(selector) - Turns selector back into a string.


License: BSD-2-Clause

Security contact information

To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

css-what for enterprise

Available as part of the Tidelift Subscription

The maintainers of css-what and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].