0.22.0 • Published 8 months ago

@splunk/themes v0.22.0

Weekly downloads
2,203
License
Apache-2.0
Repository
-
Last release
8 months ago

@splunk/themes

A collection of Splunk software theme variables and mixins. This package provides functions that can be useful in React, styled-components and other frameworks. Themes consist of plain objects containing primitives such as strings and numbers. Functions are used for mixins.

Install

Install the package:

yarn add @splunk/themes

-or-

npm install @splunk/themes

react@^16.8 and styled-components@^5.1" are required peer dependencies for all capabilities except getTheme().

React Usage

A theme context is created at the root of the application using SplunkThemeProvider.

import SplunkThemeProvider from '@splunk/themes/SplunkThemeProvider';

<SplunkThemeProvider family="prisma" density="compact" colorScheme="light">
     ...
</SplunkThemeProvider>;

Styled Components Usage

Components are themed using pick(), variables, mixins.

import { pick, variables, mixins } from '@splunk/themes';
import styled from 'styled-components';

const Wrapper = styled.div`
    ${mixins.reset()};

    color: ${pick({
         enterprise: variables.textColor,
         prisma: variables.contentColorDefault
    })};
`;

Generic Usage

Theme variables are also available outside of React and styled-components.

import getTheme from '@splunk/themes/getTheme';

const baseTheme = getTheme({family: 'prisma', colorScheme: 'light', density: 'compact' });

console.log(baseTheme.family, baseTheme.focusColor);
0.22.0

8 months ago

0.21.0

9 months ago

0.20.0

9 months ago

0.19.0

12 months ago

0.18.0

1 year ago

0.17.0

1 year ago

0.16.4

1 year ago

0.16.3

2 years ago

0.16.2

2 years ago

0.16.1

2 years ago

0.16.0

2 years ago

0.14.0

2 years ago

0.13.1

2 years ago

0.15.0

2 years ago

0.13.0

3 years ago

0.12.0

3 years ago

0.11.0

3 years ago

0.10.1

3 years ago

0.10.0

3 years ago

0.9.0

4 years ago

0.8.0

4 years ago

0.7.0

4 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago

0.4.2

5 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.1

6 years ago

0.3.0-5

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago