Skip to content

Commit

Permalink
Merge branch 'next' into feature/plugin-export
Browse files Browse the repository at this point in the history
  • Loading branch information
kagawagao authored Sep 9, 2022
2 parents e960631 + 41c6e81 commit 36a2292
Show file tree
Hide file tree
Showing 14 changed files with 307 additions and 213 deletions.
7 changes: 7 additions & 0 deletions packages/postcss-pxtransform/__tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ describe('px2rem', function () {

expect(processed).toBe(expected)
})

it('8 should work on custom baseFontSize', function () {
const processed = postcss(px2rem({ platform: 'h5', baseFontSize: 15 })).process(basicCSS).css
const expected = '.rule { font-size: 0.5rem }'

expect(processed).toBe(expected)
})
})

describe('value parsing', function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/postcss-pxtransform/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = postcss.plugin('postcss-pxtransform', function (options = {}) {
options = Object.assign({}, DEFAULT_WEAPP_OPTIONS, options)

const transUnits = ['px']
const baseFontSize = options.baseFontSize || options.minRootSize >= 1 ? options.minRootSize : 20
const baseFontSize = options.baseFontSize || (options.minRootSize >= 1 ? options.minRootSize : 20)
const designWidth = input => typeof options.designWidth === 'function'
? options.designWidth(input)
: options.designWidth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface InputState {
export interface InputProps extends FormItemProps{
style?: StyleProp<ViewStyle>;
value?: string;
type: 'text' | 'number' | 'idcard' | 'digit';
type?: 'text' | 'number' | 'idcard' | 'digit';
password?: boolean;
placeholder?: string;
disabled?: boolean;
Expand All @@ -32,8 +32,8 @@ export interface InputProps extends FormItemProps{
confirmType: 'done' | 'send' | 'search' | 'next' | 'go';
confirmHold?: boolean;
cursor?: number;
selectionStart: number;
selectionEnd: number;
selectionStart?: number;
selectionEnd?: number;
placeholderStyle?: string;
placeholderTextColor?: string;
onInput?: (evt: Event) => void;
Expand Down
Loading

0 comments on commit 36a2292

Please sign in to comment.