Skip to content

Commit

Permalink
chore: change default, close #2
Browse files Browse the repository at this point in the history
  • Loading branch information
zguolee committed Aug 16, 2022
1 parent b08ef07 commit 48b1c5e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions packages/preset-applet/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ export interface PresetAppletOptions extends PresetMiniOptions {
enableApplet?: boolean
}

export const presetApplet = (options: PresetAppletOptions = {}): Preset<Theme> => {
const presetApplet = (options: PresetAppletOptions = {}): Preset<Theme> => {
options.dark = options.dark ?? 'class'
options.attributifyPseudo = options.attributifyPseudo ?? false
options.enableApplet = options.enableApplet ?? false
options.enableApplet = options.enableApplet ?? true

return {
name: 'unocss-preset-applet',
Expand Down
26 changes: 13 additions & 13 deletions test/__snapshots__/preset-applet.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,37 @@
exports[`targets 1`] = `
"/* layer: default */
.border-custom-b{border-color:rgba(var(--custom), 1);}
.border-custom-b\\\\/0{border-color:rgba(var(--custom), 0);}
.border-custom-b\\\\/10{border-color:rgba(var(--custom), 0.1);}
.border-custom-b-div-0{border-color:rgba(var(--custom), 0);}
.border-custom-b-div-10{border-color:rgba(var(--custom), 0.1);}
.bg-custom-b{background-color:rgba(var(--custom), 1);}
.bg-custom-c{--un-bg-opacity:1;background-color:rgba(var(--custom-c),var(--un-bg-opacity));}
.bg-custom-c\\\\/10{background-color:rgba(var(--custom-c),0.1);}
.bg-custom-c-div-10{background-color:rgba(var(--custom-c),0.1);}
.bg-custom-d{background-color:hsl(var(--custom-d), 1);}
.bg-custom-d\\\\/20{background-color:hsl(var(--custom-d), 0.2);}
.bg-custom-d-div-20{background-color:hsl(var(--custom-d), 0.2);}
.bg-custom-e{--un-bg-opacity:1;background-color:hsla(var(--custom-e),var(--un-bg-opacity));}
.bg-custom-e\\\\/30{background-color:hsla(var(--custom-e),0.3);}
.bg-custom-e-div-30{background-color:hsla(var(--custom-e),0.3);}
.bg-custom-f{--un-bg-opacity:1;background-color:lch(var(--custom-f) / var(--un-bg-opacity));}
.bg-custom-f\\\\/\\\\[var\\\\(--f-op\\\\)\\\\]{background-color:lch(var(--custom-f) / var(--f-op));}
.bg-custom-f\\\\/30{background-color:lch(var(--custom-f) / 0.3);}
.bg-custom-f-div-30{background-color:lch(var(--custom-f) / 0.3);}
.bg-custom-f-div-l-varp---f-op-q-r{background-color:lch(var(--custom-f) / var(--f-op));}
.bg-info{--un-bg-opacity:1;background-color:hsla(200.1,100%,54.3%,var(--un-bg-opacity));}
.bg-info\\\\/\\\\[10\\\\%\\\\]{background-color:hsla(200.1,100%,54.3%,10%);}
.bg-info\\\\/10{background-color:hsla(200.1,100%,54.3%,0.1);}
.bg-info-div-10{background-color:hsla(200.1,100%,54.3%,0.1);}
.bg-info-div-l-10-pct-r{background-color:hsla(200.1,100%,54.3%,10%);}
.mix-shade-50-c-red-400{--un-text-opacity:1;color:rgba(calc(248 + (0 - 248) * 50 / 100),calc(113 + (0 - 113) * 50 / 100),calc(113 + (0 - 113) * 50 / 100),calc(var(--un-text-opacity) + (1 - var(--un-text-opacity)) * 50 / 100));}
.mix-shift--50-c-red-600{--un-text-opacity:1;color:rgba(calc(220 + (255 - 220) * 50 / 100),calc(38 + (255 - 38) * 50 / 100),calc(38 + (255 - 38) * 50 / 100),calc(var(--un-text-opacity) + (1 - var(--un-text-opacity)) * 50 / 100));}
.mix-shift-50-c-red-600{--un-text-opacity:1;color:rgba(calc(220 + (0 - 220) * 50 / 100),calc(38 + (0 - 38) * 50 / 100),calc(38 + (0 - 38) * 50 / 100),calc(var(--un-text-opacity) + (1 - var(--un-text-opacity)) * 50 / 100));}
.mix-tint-50-c-red-400{--un-text-opacity:1;color:rgba(calc(248 + (255 - 248) * 50 / 100),calc(113 + (255 - 113) * 50 / 100),calc(113 + (255 - 113) * 50 / 100),calc(var(--un-text-opacity) + (1 - var(--un-text-opacity)) * 50 / 100));}
.text-custom-a{color:var(--custom);}
.focus\\\\:placeholder-red-300:focus::placeholder{--un-placeholder-opacity:1;color:rgba(252,165,165,var(--un-placeholder-opacity));}
.focus-c-placeholder-red-300:focus::placeholder{--un-placeholder-opacity:1;color:rgba(252,165,165,var(--un-placeholder-opacity));}
.placeholder-inherit::placeholder{color:inherit;}
.placeholder-red-400::placeholder{--un-placeholder-opacity:1;color:rgba(248,113,113,var(--un-placeholder-opacity));}
.hover\\\\:placeholder-op90:hover::placeholder,
.hover-c-placeholder-op90:hover::placeholder,
.placeholder-op90::placeholder{--un-placeholder-opacity:0.9;}
.placeholder-opacity-10::placeholder{--un-placeholder-opacity:0.1;}
@media (hover: none) and (pointer: coarse){
.media-touch\\\\:p-4{padding:1rem;}
.media-touch-c-p-4{padding:1rem;}
}
@media (prefers-reduced-transparency: reduce){
.media-opacity_not_ok\\\\:opacity-0{opacity:0;}
.media-opacity_not_ok-c-opacity-0{opacity:0;}
}"
`;

Expand Down
6 changes: 3 additions & 3 deletions test/transformer-rename-class.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('transformer-rename-class', () => {
{{ \`index\${index + 1}\` }}
</div>
<div class="py-3.5 grid-cols-[0.7fr_repeat(7,1fr)]">
py-3
py-4.5
</div>
<div class="bg-[url('/img/hero-pattern.svg')]">
uniapp
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('transformer-rename-class', () => {
{{ \`index\${index + 1}\` }}
</div>
<div class=\\"uno-0tr0xg\\">
py-3
py-4.5
</div>
<div class=\\"uno-qdng63\\">
uniapp
Expand Down Expand Up @@ -105,7 +105,7 @@ describe('transformer-rename-class', () => {
.items-center{align-items:center;}
.justify-center{justify-content:center;}
.p-1{padding:0.25rem;}
.py-3{padding-top:0.75rem;padding-bottom:0.75rem;}
.py-4\\\\.5{padding-top:1.125rem;padding-bottom:1.125rem;}
.text-4xl{font-size:2.25rem;line-height:2.5rem;}
.text-green-500{--un-text-opacity:1;color:rgba(34,197,94,var(--un-text-opacity));}
.text-yellow-500{--un-text-opacity:1;color:rgba(234,179,8,var(--un-text-opacity));}",
Expand Down

0 comments on commit 48b1c5e

Please sign in to comment.