Theme
The Atlaskit theme framework, helpers and the ADG color palette.
Installation
yarn add @atlaskit/theme
Usage
Detailed docs and example usage can be found here.
Theme contains solutions for global theming, colors, typography and other useful mixins.
The Atlaskit theme framework, helpers and the ADG color palette.
yarn add @atlaskit/theme
Detailed docs and example usage can be found here.
9f62ecec4d422
-
Update dependencies.cb318c8c28c26
-
Internal changes to typography.0384c8ac8996a
-
Remove fontStyle inherit from heading mixins.962b5e77810fb
-
Adds side-effect config to support Compiled css extraction in third-party apps#153471
ed0f31dd83e14
-
Removes deprecated elevation utilities in favor of tokens.
The following elevation utilities have been removed, please use the tokens instead:
-import { elevation } from '@atlaskit/theme';
-import elevation from '@atlaskit/theme/elevation';
+import { N50A, N40A, N60A } from '@atlaskit/theme/colors';
+import { token } from '@atlaskit/tokens';
-elevation.e100();
+box-shadow: ${token( 'elevation.shadow.raised', `0 1px 1px ${N50A}, 0 0 1px 1px ${N40A}`, )};
-elevation.e200();
+box-shadow: ${token( 'elevation.shadow.overlay', `0 4px 8px -2px ${N50A}, 0 0 1px ${N60A}`, )};
-elevation.e300();
+box-shadow: ${token( 'elevation.shadow.overlay', `0 8px 16px -4px ${N50A}, 0 0 1px ${N60A}`, )};
-elevation.e400();
+box-shadow: ${token( 'elevation.shadow.overlay', `0 12px 24px -6px ${N50A}, 0 0 1px ${N60A}`, )};
-elevation.e500();
+box-shadow: ${token( 'elevation.shadow.overlay', `0 20px 32px -8px ${N50A}, 0 0 1px ${N60A}`, )};
e5681b43dca9e
-
[ux] This changes the new theme colors,ie, button colour changes introduced as per visual refresh
changes#129411
300b0a472d9ce
-
Removes deprecated theme mixins and variables. These mixins and variables can be directly replaced
with design tokens from @atlaskit/tokens
and @atlaskit/theme/colors
.
This change can be automated by running the following codemod:
npx @atlaskit/codemod-cli -n theme-remove-deprecated-mixins --extensions tsx --parser tsx path/to/src
Here is a mapping of the old mixins and variables to the new design tokens:
import styled from 'styled-components';
+import { token } from '@atlaskit/tokens'
+import {
+ B200
+ B300
+ B400
+ B50
+ B500
+ G300
+ N0
+ N200
+ N20A
+ N30
+ N800
+ N900
+ P300
+ R300
+ T300
+ Y300
+} from '@atlaskit/theme/colors';
const Box = styled.div`
- background-color: ${background};
+ background-color: ${token('elevation.surface', N0)};
- background-color: ${backgroundActive};
+ background-color: ${token('color.background.selected', B50)};
- background-color: ${backgroundHover};
+ background-color: ${token('color.background.neutral.hovered', N30)};
- background-color: ${backgroundOnLayer};
+ background-color: ${token('elevation.surface.overlay', N0)};
- color: ${text};
+ color: ${token('color.text', N900)};
- color: ${textHover};
+ color: ${token('color.text', N800)};
- color: ${textActive};
+ color: ${token('color.text.selected', B400)};
- color: ${subtleText};
+ color: ${token('color.text.subtlest', N200)};
- color: ${placeholderText};
+ color: ${token('color.text.subtlest', N200)};
- color: ${heading};
+ color: ${token('color.text', N800)};
- color: ${subtleHeading};
+ color: ${token('color.text.subtlest', N200)};
- color: ${codeBlock};
+ color: ${N20};
- color: ${link};
+ color: ${token('color.link', B400)};
- color: ${linkHover};
+ color: ${token('color.link.pressed', B300)};
- color: ${linkActive};
+ color: ${token('color.link.pressed', B500)};
- border-color: ${linkOutline};
+ border-color: ${token('color.border.focused', B200)};
- background-color: ${primary};
+ background-color: ${token('color.background.brand.bold', B400)};
- background-color: ${skeleton};
+ background-color: ${token('color.skeleton', N20A)};
- color: ${blue};
+ color: ${B400};
- color: ${teal};
+ color: ${T300};
- color: ${purple};
+ color: ${P300};
- color: ${red};
+ color: ${R300};
- color: ${yellow};
+ color: ${Y300};
- color: ${green};
+ color: ${G300};
`;
#127511
db30e29344013
-
Widening range of react
and react-dom
peer dependencies from ^16.8.0 || ^17.0.0 || ~18.2.0
to the wider range of ^16.8.0 || ^17.0.0 || ^18.0.0` (where applicable).
This change has been done to enable usage of `react@18.3as well as to have a consistent peer
dependency range for
reactand
react-domfor
/platform` packages.
77504ff274f72
-
DSP-19576: Assign names to anonymous default exportsff0815316ab38
-
Removes usage of custom theme button in places where its API is not being used and the default
button is able to be used instead. This should give a slight performance (runtime) improvement.f2f51e7a24d00
-
Deprecate constants fontSize, fontSizeSmall, fontFamily, and codeFontFamily. Token equivalents
should be used instead.d131599730792
-
Explicitly set jsxRuntime to classic via pragma comments in order to avoid issues where jsxRuntime
is implicitly set to automatic.10443be28cedb
-
converting tagged template syntax to object syntax for remanining styles from DSP-176260bea5b4f8cc5
-
Add support for React 18 in non-strict mode.042d4fd3bc81
-
Updated the children
prop in the Consumer
component to always be of type
(tokens: ThemeTokens) => ReactNode
which improves compatibility with React 1871dfcbc00239
-
Added temporary font fallback definitions for use exclusively as token fallback values.8d4e99057fe0
-
Upgrade Typescript from 4.9.5
to 5.4.2
7febfed958dd
-
Update usage of React.FC
to explicity include children
b037e5451037
-
Update new button text color fallback for default theme (non-token) to match that of old button
current text color13f5d2d5911d
-
Minor internal codemod tweakse6b69f455c3
- Connect
yarn changeset to packages, upgrade adf-schemac6db573350d
- The
themed() and AtlaskitThemeProvider legacy theming API's are now marked as deprecated and eslint
rules have been modified to disallow new usage of them.ebefd4048ff
- Set
tooltip zindex to 99999af31f3c1ae
- Delete
version.json69648c31426
- correct
border.focused fallback to B200 to meet contrast requirementb1bdec7cce2
- Internal
change to enforce token usage for spacing properties. There is no expected visual or behaviour
change.9d00501a414
- Ensure
legacy types are published for TS 4.5-4.841fae2c6f68
- Upgrade
Typescript from 4.5.5
to 4.9.5
5e717fd317d
- [ux]
correct light mode fallback color of deprecated placeholder util56507598609
- Skip
minor dependency bumpe77500e9f1e
- Migrates
unit tests from enzyme to RTL.3993abb044c
- Adds
deprecation jsdoc warnings to typography mixins. Please use @atlaskit/heading
if these mixins
are currently being relied upon.5e26db5a6a1
-
Deprecate gridSize
in favor of space tokens. More information about the new spacing scale and
tokens can be found at https://atlassian.design/foundations/spacing/#scale261420360ec
- Upgrades
component types to support React 18.7f5f23dcb68
-
Introduce shape tokens to some packages.1439e7f646c
- Add
theme into push model consumptionb0f6dd0bc35
- Updated
to use typography tokens. There is no expected behaviour or visual change.9827dcb82b8
- No-op
change to introduce spacing tokens to design system components.8cc2f888c83
- Upgrade
Typescript from 4.3.5
to 4.5.5
8264d59a847
- Updates
@emotion/core
to @emotion/react
; v10 to v11. There is no expected behavior change.8d4228767b0
- Upgrade
Typescript from 4.2.4
to 4.3.5
.c8145459eb5
- [ux]
Updating skeleton token in @atlakist/menu, @atlaskit/themecb2392f6d33
- Upgrade
to TypeScript 4.2.462edf20ab1e
- Migrates
all usage of brand tokens to either selected or information tokens. This change is purely for
semantic reasons, there are no visual or behavioural changes.58884c2f6c1
- Internal
code change turning on a new linting rule.f9ee7954a18
- Adds
deprecation messages to visuallyHidden
and focusRing
exports.19d72473dfb
- The
no-unsafe-design-token-usage eslint rule now respects the new token naming conventions when
auto-fixing by correctly formatting token ids.#17576
85d6182cad7
-
Note: It is a re-release of the wrongly patched
version 12.0.2
that should have been a
minor
release.
[ux] Instrumented theme with the new theming package, @atlaskit/tokens.
New tokens will be visible only in applications configured to use the new Tokens API (currently in alpha). These changes are intended to be interoperable with the legacy theme implementation. Legacy dark mode users should expect no visual or breaking changes.
WRONG RELEASE TYPE - DON'T USE
#15998
420621d097e
- [ux]
Instrumented theme with the new theming package, @atlaskit/tokens.
New tokens will be visible only in applications configured to use the new Tokens API (currently in alpha). These changes are intended to be interoperable with the legacy theme implementation. Legacy dark mode users should expect no visual or breaking changes.
f460cc7c411
- Builds
for this package now pass through a tokens babel plugin, removing runtime invocations of the
tokens() function and improving bundle size.b99deb544f9
- Patches
an unsafe selector used by Theme in older browsers.#14319
cf853e39278
-
Breaking Changes:
styled-components
. styled-components
was used
exclusively in AtlaskitThemeProvider
and Reset
. Reset
has been removed (see below), while
AtlaskitThemeProvider
has been re-worked to remove the need for the dependency. To maintain
compatibility we've provided a codemod to migrate usage.math
has been formally removed from the package. The usage of this package was already
discouraged but for any remaining usages there is a codemod to migrate your code.Reset
has been removed. We want to lean more on the @atlaskit/css-reset
as a canonical
approach to resetting.Appearance
has been removed, this HOC component had no usageFLATTENED
has been removed, this constant had no usageHousekeeping:
exenv
Context
has been removed from the package; this component wasn't ever exportedUpgrading with codemod
You first need to have the latest version of @atlaskit/theme
installed before you can run the
codemod
yarn upgrade @atlaskit/theme@^12.0.0
Then you can use our cli tool to run the codemod.
npx @atlaskit/codemod-cli /path/to/target/directory --parser [tsx | flow | babel]
This will automatically migrate math
and the AtlaskitThemeProvider
to the updated usage.
cf853e39278
- Fixes a
bug where the AKThemeProvider could add multiple style elements on the same page if multiple
instances of the component were supplied.cf853e39278
- The
AtlaskitThemeProvider
has been reworked to be a functional component internally using hooks.cf853e39278
- Add
codemod for replacing @atlaskit/theme/math
functions with simple binary JS expressions.3316bd1f594
- The h300
function in @atlaskit/theme/typography now returns a constant string literal for the textTransform
field now. This should make it compatible with React's style prop type definitions, by extension,
Emotion.a8634047ae4
- Internal
color change to use tokens.950a744a150
- [ux]
Typography colors now use tokens.e6b210c7e2e
- Removes
styled-components from common entrypoints "typography" and "constants" in favour of using a syntax
that is compatible between both emotion and styled-components.adf3cbfbd47
- [ux] Fix
Reset text color20c3881896c
- Exposes
useGlobalTheme
from components entrypoint0d348445e23
-
AKThemeProvider now correctly refreshes the ThemeProvider context when the mode changes.#9756
bc02e5ad605
- Theme
now exposes an additional custom hook for consumption of the theme that behave the same as the
Consumer
component. useTheme
is returned in addition to the Provider
and Consumer
in the
createTheme
function.
For ease of consumption of the global theme, a pre-configured usage of useTheme
hook has been
also been exported as useGlobalTheme
.
bb0886583a0
- Adding
new Layers type for optimised layer name to z-index conversiond3265f19be
- Transpile
packages using babel rather than tsc5f58283e1f
- Export
types using Typescript's new "export type" syntax to satisfy Typescript's --isolatedModules
compiler option. This requires version 3.8 of Typescript, read more about how we handle Typescript
versions here: https://atlaskit.atlassian.com/get-started Also add typescript
to
devDependencies
to denote version that the package was built with.#5344
42803d6708
- Remove
references to deep import paths in TS declaration files.
Released as a major to force dependents with deep import paths to no longer be able to reference newer versions of theme
e45be534ce
- [ux]
Unwinding anchor style change in AltaskitThemeProvider. Restoring color: !important to button to
deal with specificity wars642a8a7735
- [ux]
AtlaskitThemeProvider
(deprecated) applies a colour reset to anchor tags. This was impacting the
colouring of @atlaskit/button
. To go around specificity issues caused by AtlaskitThemeProvider
in the past @atlaskit/button
would apply a !important
to it's color
values. We have changed
AtlaskitThemeProvider
so that it will no longer impact the color
values of @atlaskit/button
#3885
6c525a8229
- Upgraded
to TypeScript 3.9.6 and tslib to 2.0.0
Since tslib is a dependency for all our packages we recommend that products also follow this tslib upgrade to prevent duplicates of tslib being bundled.
676a1c7aa3
- regenerate
snapshot for vr0408cc26ef
- Declare
entry points in af:exports field of package.json682940909a
- CCCEM-1212
Customize background color in AtlaskitThemeProvider60dd4ecc69
- Changed
export all to export individual components in index7b90a82e88
- Update the
elevation to work correctly in Safari and Edge <79 correctlydb053b24d8
- Update all
the theme imports to be tree-shakable87f4720f27
- Officially
dropping IE11 support, from this version onwards there are no warranties of the package working in
IE11. For more information see:
https://community.developer.atlassian.com/t/atlaskit-to-drop-support-for-internet-explorer-11-from-1st-july-2020/395349326de67db
- fix:
return default theme mode if mode is other than 'light' or 'dark'39faba6e98
- Update all
the theme imports to something tree-shakable54a9514fcf
- Build and
supporting files will no longer be published to npm[patch]0c270847cb:
Fixes skeleton color to N20A.- [patch]b9903e773a:
Updates skeleton shimmer to be a pulse. Will introduce shimmer effect for small viewports later.- Updated dependencies 168b5f90e5:
Updated dependencies 109004a98e:
[patch]1dd42d3002:
Fixes theme providers having unstable references in their value prop.
[patch]6548261c9a:
Remove namespace imports from React, ReactDom, and PropTypes- Updated dependencies 6548261c9a:
[minor]82747f2922:
Adds visually hidden mixin. This can be used with any css-in-js library.
[minor]429925f854:
Adds skeleton
color. Import and use like:
import { skeleton } from '@atlaskit/theme';
skeleton(); // '#F4F5F7'
[minor]f9c291923c:
Corrects the type exports for typography, colors, elevation and layers. If you were doing any dynamic code it may break you. Refer to the upgrade guide for help upgrading.
[patch]3c0f6feee5:
Fixes types property in package json to point to the correct location.
[patch]ea75c17b3a:
internal typescript fixes
[patch]c3dc8235f2:
Preventing circular dep within theme
[patch]d222c2b987:
Theme has been converted to Typescript. Typescript consumers will now get static type safety. Flow types are no longer provided.
** getTokens props changes ** When defining the value function passed into a ThemeProvider, the
getTokens parameter cannot be called without props; if no props are provided an empty object {}
must be passed in:
<CustomTheme.Provider
value={t => ({ ...t(), backgroundColor: '#333'})}
>
becomes:
<CustomTheme.Provider
value={t => ({ ...t({}), backgroundColor: '#333'})}
>
** Color palette changes ** Color palettes have been moved into their own file. Users will need to update imports from this:
import { colors } from '@atlaskit/theme';
colors.colorPalette('8');
to this:
import { colorPalette } from '@atlaskit/theme';
colorPalette.colorPalette('8');
or for multi entry-point users:
import * as colors from '@atlaskit/theme/colors';
colors.colorPalette('8');
to this:
import * as colorPalettes from '@atlaskit/theme/color-palette';
colorPalettes.colorPalette('8');
[patch]2119c45dfc:
Add missing Theme/GlobalThemeTokens to constants.d.ts
[patch]35d2229b2a:
Adding missing license to packages and update to Copyright 2019 Atlassian Pty Ltd.
[patch]decd6fceea:
ED-5137 added heading anchor link
Values for heading sizes(h100 - h900) are exported as part of typography. Places need to calculate heights for heading can use those values to calculate.
[patch]8d0f37c23e:
@atlaskit/avatar has been converted to Typescript. Typescript consumers will now get static type safety. Flow types are no longer provided. No API or behavioural changes.
[patch]94620ae46a:
Updating the temporary ts definition file for Theme.
[minor]c6efb2f5b6:
Prefix the legacy lifecycle methods with UNSAFE_* to avoid warning in React 16.9+
More information about the deprecation of lifecycles methods can be found here: https://reactjs.org/blog/2018/03/29/react-v-16-3.html#component-lifecycle-changes
[patch]097b696613:
Components now depend on TS 3.6 internally, in order to fix an issue with TS resolving non-relative imports as relative imports
[patch]ecca4d1dbb:
Upgraded Typescript to 3.3.x
[patch]9eceb8379f:
Moves typescript declaration files to the root of theme
[patch]de35ce8c67:
Updates component maintainers
[patch]c6ad66d326:
The types property in package.json now points to the correct file"
[patch]4615439434:
index.ts will now be ignored when publishing to npm
[minor]70862830d6:
[patch]d5f0e7d767:
[major]7c17b35107:
[patch]e0e3fabf8e:
[patch]453838d3c5:
[patch]9c0b4744be:
[patch]9ac668e13d:
[patch]4368278bb4:
import { N500, N0 } from '@atlaskit/theme/colors';
import { focusRing } from '@atlaskit/theme/constants';
import { withTheme } from '@atlaskit/theme/components';
[patch]b4732a178b:
[patch]0f17bb7c20:
[patch]7fe933beaa:
[minor]a561af5fc6:
[patch]5150860405:
[major]76299208e6:
As a breaking change, all @atlaskit packages will be dropping cjs distributions and will only
distribute esm. This means all distributed code will be transpiled, but will still contain
import
and export
declarations.
The major reason for doing this is to allow us to support multiple entry points in packages, e.g:
import colors from `@atlaskit/theme/colors`;
Previously this was sort of possible for consumers by doing something like:
import colors from `@atlaskit/theme/dist/esm/colors`;
This has a couple of issues. 1, it treats the file system as API making internal refactors harder, we have to worry about how consumers might be using things that aren't actually supposed to be used. 2. We are unable to do this internally in @atlaskit packages. This leads to lots of packages bundling all of theme, just to use a single color, especially in situations where tree shaking fails.
To support being able to use multiple entrypoints internally, we unfortunately cannot have multiple distributions as they would need to have very different imports from of their own internal dependencies.
ES Modules are widely supported by all modern bundlers and can be worked around in node environments.
We may choose to revisit this solution in the future if we find any unintended condequences, but we see this as a pretty sane path forward which should lead to some major bundle size decreases, saner API's and simpler package architecture.
Please reach out to #fabric-build (if in Atlassian) or create an issue in Design System Support (for external) if you have any questions or queries about this.
[patch]b46504d2e4:
[patch]1a98f74:
[patch]899fac7:
[patch]ca16fa9:
[major]d13242d: