Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support attribute selector variants #151

Merged
merged 2 commits into from
Mar 20, 2021
Merged

Conversation

sastan
Copy link
Collaborator

@sastan sastan commented Mar 20, 2021

This PR allows using attribute selectors as variants.

Class Name Selector
[lang]:font-bold [lang\]\:font-bold[lang
not-[lang]:italic .not-\[lang\]\:italic:not([lang])
[aria-expanded='true']:font-bold [aria-expanded\=\'true\'\]\:font-bold[aria-expanded='true']
[data-reach-menu-item][data-selected]:bg-red-300 [data-reach-menu-item\]\[data-selected\]\:bg-red-300[data-reach-menu-item][data-selected]
[href^='#']:bg-yellow-400 [href\^\=\'\#\'\]\:bg-yellow-400[href^='#']
[href*='example']:bg-gray-300 [href\*\=\'example\'\]\:bg-gray-300[href*='example']
[href$='.org']:bg-red-400 [href\$\=\'\.org\'\]\:bg-red-400[href$='.org']
[href^='https'][href$='.org']:bg-green-400 [href\^\=\'https\'\]\[href\$\=\'\.org\'\]\:bg-green-400[href^='https'][href$='.org']
[lang~='en-us']:text-blue-400 [lang\~\=\'en-us\'\]\:text-blue-400[lang~='en-us']
[lang|='zh']:text-red-400 [lang\|\=\'zh\'\]\:text-red-400[lang|='zh']
[data-lang='zh-TW']:text-purple-400 [data-lang\=\'zh-TW\'\]\:text-purple-400[data-lang='zh-TW']

@coveralls
Copy link

Pull Request Test Coverage Report for Build 671031001

  • 0 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.3%) to 93.966%

Totals Coverage Status
Change from base Build 670792435: 0.3%
Covered Lines: 4991
Relevant Lines: 5309

💛 - Coveralls

@coveralls
Copy link

coveralls commented Mar 20, 2021

Pull Request Test Coverage Report for Build 671487433

  • 14 of 25 (56.0%) changed or added relevant lines in 2 files are covered.
  • 6 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.1%) to 93.562%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/twind/configure.ts 4 15 26.67%
Files with Coverage Reduction New Missed Lines %
src/twind/configure.ts 2 93.79%
src/twind/decorate.ts 4 84.21%
Totals Coverage Status
Change from base Build 670792435: -0.1%
Covered Lines: 4999
Relevant Lines: 5323

💛 - Coveralls

@github-actions
Copy link
Contributor

Try the Preview Package

Official releases are only available on registry.npmjs.org as twind.

This PR has been published to npm.pkg.github.com as @tw-in-js/twind@pr151.

Install/Update

Configure your NPM client (click to expand)
  1. Generate a personal access token with at least "read:packages" scope.
  2. Adjust your .npmrc to use the token and define the regeistry for @tw-in-js:
//npm.pkg.github.com/:_authToken=<READ_PACKAGES_TOKEN>
@tw-in-js:registry=https://npm.pkg.github.com

Using the command line:

npm config set //npm.pkg.github.com/:_authToken <READ_PACKAGES_TOKEN> --global
npm config set @tw-in-js:registry https://npm.pkg.github.com --global
# For npm
npm install --force twind@npm:@tw-in-js/twind@pr151

# For yarn - upgrade implies install
yarn upgrade twind@npm:@tw-in-js/twind@pr151

@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2021

size-limit report 📦

Path Size
dist/twind.js 12.76 KB (+0.24% 🔺)
dist/css/css.js 1.14 KB (0%)
dist/observe/observe.js 665 B (0%)
dist/shim/shim.js 403 B (0%)
dist/style/style.js 948 B (0%)

@sastan sastan force-pushed the attribute-selector-variants branch from 990e438 to 631a04f Compare March 20, 2021 19:25
@sastan sastan merged commit ba46fb7 into main Mar 20, 2021
@sastan sastan deleted the attribute-selector-variants branch March 20, 2021 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants