
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@core-ds/primitives
Advanced tools
npm install @core-ds/primitives
After installing the @core-ds/primitives npm package, you can import and apply it in any JavaScript/TypeScript file:
import styled from "styled-components";
import { color, space } from "@core-ds/primitives";
const Example = styled.div`
color: ${color.white};
background-color: ${color.blue[500]};
padding: ${space[4]};
&:hover {
background-color: ${color.blue[800]};
}
`;
LESS Core Primitives are globally available in every LESS file in the iFixit/ifixit repo:
element {
color: @color-white;
background-color: @color-blue-500;
padding: @space-4;
&:hover {
background-color: @color-blue-800;
}
}
See the complete list of LESS variables here.
CSS Core Primitives are globally available on the :root
(html) element. They can be used in any (P)HTML file:
/* excerpt from core-primitives.css */
:root {
--color-black: #11161a;
--color-white: #fff;
...
--color-blue-500: #3b82f6;
--color-blue-600: #2563eb;
--color-blue-700: #1d4ed8;
--color-blue-800: #1e40af;
...
--space-3: 12px;
--space-4: 16px;
--space-5: 24px;
...
}
/* style the element */
element {
color: var(--color-white);
background-color: var(--color-blue-500);
padding: var(--space-4);
&:hover {
background-color: var(--color-blue-800);
}
}
See the current list of CSS Custom Properties here.
For more capabilities, check out the MDN Custom Properties article
Follow these steps to get the project setup on your local machine:
# Clone repo
git clone https://github.com/iFixit/core-primitives.git && cd core-primitives
# Install dependencies
npm install
Create a new branch for your changes:
git checkout -b <branch>
Apply your changes to index.json
, and keep index.d.ts
in sync.
Run npm run build
and verify core-primitives.css
and core-primitives.less
are correct.
Use GitHub to create a pull request for your branch.
After your pull request has been approved, bump the package version by running:
npm version [major | minor | patch]
Running npm version
will build, bump the version, and write the new data to package.json
and package-lock.json
. It will also create and push a version commit and tag.
Note: In the context of
@core-ds/primitives
, significant changes to the library or workflow, or removing primitives would be considered a major update, adding or updating primitives would be considered a minor update, and fixing primitives would be considered a patch. Non-code changes (e.g. documentation) do not require a version bump.
npm publish
After your pull request has been merged, create a new release to document your changes. Use the tag you generated in step 4 to create the release.
Done 🎉
FAQs
Unknown package
We found that @core-ds/primitives demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.