We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When using tags nested in another tag, styles are not correctly rendered.
Reproduce using this code
// Font Import Font.register({ family: 'Inter-Regular', src: 'https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfMZg.ttf', }); Font.register({ family: 'Inter-Bold', src: 'https://fonts.gstatic.com/s/inter/v13/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYMZg.ttf', }); // Create styles const styles = StyleSheet.create({ page: { paddingTop: 35, paddingBottom: 65, paddingHorizontal: 35, fontFamily: 'Inter-Regular', fontSize: 9, }, regularText: { fontFamily: 'Inter-Regular', }, boldText: { fontFamily: 'Inter-Bold', }, });
<Document> <Page size="A4" style={styles.page}> {/* Example of text style inheritance bug */} <Text style={[styles.regularText]}> <Text style={[styles.boldText]}>{`Label: `}</Text> <Text style={[styles.regularText]}>{`Value`}</Text> </Text> <Text style={[styles.boldText]}>{`Label: `}</Text> <Text style={[styles.regularText]}>{`Value`}</Text> </Page> </Document>
Each tag should render for it's own styles (or inherits styles from parent tags), and should not be attributed styles of preceding tag.
When nested in a parent tag (regardless of that tag's styles), the second child tag is incorrectly attributed the styles of the first child tag.
See three examples in the screenshot below:
No response
Chrome: 124.0.6367.119 ├─ @react-pdf/[email protected] ├─ @react-pdf/[email protected] ├─ @react-pdf/[email protected] ├─ @react-pdf/[email protected] ├─ @react-pdf/[email protected] ├─ @react-pdf/[email protected] ├─ @react-pdf/[email protected] ├─ @react-pdf/[email protected] ├─ @react-pdf/[email protected] ├─ @react-pdf/[email protected] ├─ @react-pdf/[email protected] └─ @react-pdf/[email protected]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Before you start - checklist
Description
When using tags nested in another tag, styles are not correctly rendered.
Steps to reproduce
Reproduce using this code
Expected behavior
Each tag should render for it's own styles (or inherits styles from parent tags), and should not be attributed styles of preceding tag.
Actual behavior
When nested in a parent tag (regardless of that tag's styles), the second child tag is incorrectly attributed the styles of the first child tag.
See three examples in the screenshot below:
Additional information
No response
Environment
Chrome: 124.0.6367.119
├─ @react-pdf/[email protected]
├─ @react-pdf/[email protected]
├─ @react-pdf/[email protected]
├─ @react-pdf/[email protected]
├─ @react-pdf/[email protected]
├─ @react-pdf/[email protected]
├─ @react-pdf/[email protected]
├─ @react-pdf/[email protected]
├─ @react-pdf/[email protected]
├─ @react-pdf/[email protected]
├─ @react-pdf/[email protected]
└─ @react-pdf/[email protected]
The text was updated successfully, but these errors were encountered: