Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@hig/theme-data
Advanced tools
HIG theme data is a representation of the HIG visual design language in the form of data.
yarn add @hig/theme-data
import lightGrayMediumDensityTheme from '@hig/theme-data/build/json/lightGrayMediumDensityTheme/resolvedRoles.json';
console.log(lightGrayMediumDensityTheme);
// {
// "basics.borderRadii.none": "0",
// "basics.borderRadii.small": "0"
// "basics.borderRadii.medium": "2px"
// ...
// }
import resolvedRoles from '@hig/theme-data/build/json/lightGrayMediumDensityTheme/resolvedRoles.json';
import unresolvedRoles from '@hig/theme-data/build/json/lightGrayMediumDensityTheme/unresolvedRoles.json';
import { extendTheme, resolveTheme } from '@hig/theme-data';
const redAccentedUnresolvedTheme = extendTheme(unresolvedRoles, {
"colorScheme.accentColor500": "#F00",
});
const redAccentedTheme = resolveTheme(redAccentedUnresolvedTheme);
console.log(redAccentedTheme);
// {
// ...
// "colorScheme.accentColor500": "#F00",
// "input.focus.borderBottomColor": "#F00"
// ...
// }
Named values (colors, spacings, typographic specifications, etc.) from which most (all?) other values in a theme are derived
A property of a component provided by a theme. E.g. Divider is a component. '1px' is a border width. DIVIDER.BORDER_WIDTH
is a role mapping a width to the border width property of the divider component.
Data defining a primitive value (e.g. “#0696D7” or “16px”) for each role in the theme schema.
Data defining a primitive value or reference for each role in the theme schema.
References in a theme configuration may point to a basic value or another role. References may point to roles defined with another reference. For example, textArea.focus.color
may refer to input.focus.color
, which refers to accentColor
, which refers to basics.colors.autodeskBlue600
.
We have chosen to model theme data more simply than the domain.
In terms of domain, at the highest level, values in a theme fall into three categories—basics, system-level, and component-specific. Examples of system-level values are accent colors, default text properties, and colors of background surfaces. Component-level values fit into a hierarchy beginning with category (e.g. form fields), below that falls component (e.g. select element), then sub-component (e.g. option element). Category, component, and subcomponent are arbitrarily deep, and not all components fall within a category. Within a component values vary according to state. Component states are better represented by a node-map than a tree. Finally, for a given state, a value maps to a property (e.g. background color).
Theme
- Basics
- System-level values
- Component values
- Category - optional
- Component
- Subcomponent - arbitrarily deep
- State* - more of a node map than a tree
- Property: value
In data we model the theme as a flat map of key-value pairs. We represent the hierarchy in the key, but only as much as is needed to disambiguate one key from another. e.g. a role in the theme may have a key such as textAreaDisabled.textColor
. The key uses component name, state name, and property name but does not describe a category.
FAQs
HIG Theme Data
The npm package @hig/theme-data receives a total of 0 weekly downloads. As such, @hig/theme-data popularity was classified as not popular.
We found that @hig/theme-data demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.