Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@thoughtbot/react-native-typescript-styles
Advanced tools
CLI utility for adding the styles from react-native-typescript-styles to your project.
Kick-start your new React Native TypeScript project with simple, organized styles and have less churn in your style files.
Every React Native project uses styles, but React Native itself is not opinionated in how to organize them. This puts the burden on the developer to decide on and implement a method of organization, which takes time and effort that you could be spending on feature development.
This project is a starter framework for organizing styles in new React Native projects.
// yarn
yarn global add @thoughtbot/react-native-typescript-styles
or
// npm
npm install -g @thoughtbot/react-native-typescript-styles
rnts
yarn add react-native-typography
The Typography module uses this library as it makes it easy to use the default system font families and weights on both iOS and Android.
import { Buttons, Colors, Outlines, Sizing, Typography } from "../styles";
const style = StyleSheet.create({
header: {
paddingBottom: Sizing.x20,
borderBottomWidth: Outlines.borderWidth.thin,
borderColor: Colors.neutral.gray6,
},
headerText: {
...Typography.bold.x50,
},
button: {
...Buttons.bar.primary,
},
buttonText: {
...Buttons.barText.primary,
},
});
// colors.ts
type Brand = "primary" | "secondary";
export const brand: Record<Brand, string> = {
primary: "#0c00a6",
secondary: "#f03f0a",
};
An example app is located in a separate repository: react-native-typescript-styles-example.
This project is intended to establish a structure for organizing a design system. Therefore, the styles themselves are not opinionated in terms of visual design. Users are expected to adapt the styles to the needs of their project. This may include changing or adding colors, typography, buttons, etc.
The styles within this project are separated by category into modules, including
Colors
, Sizing
, and Buttons
. Each module contains a set of objects which
provide styles for a specific kind of thing within the module category. For
example, the Colors
module provides objects for primary
and neutral
colors. Finally, each of these objects itself provides key/value pairs for
specific styles: in this case, particular primary and neutral colors.
Styles are then used as such:
color: Colors.primary.blue
Style guide: Style Guide
Blog post: "React Native Styling: Structure for Style Organization"
react-native-typescript-styles is maintained and funded by thoughtbot, inc. The names and logos for thoughtbot are trademarks of thoughtbot, inc.
We love open source software! See our other projects or hire us to design, develop, and grow your product.
FAQs
CLI utility for adding the styles from react-native-typescript-styles to your project.
We found that @thoughtbot/react-native-typescript-styles demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.