2.1.1 • Published 1 year ago

@ta-interaktiv/react-theme-switch v2.1.1

Weekly downloads
57
License
ISC
Repository
gitlab
Last release
1 year ago

React Theme Switch

Loads an additional style sheet based on the provided media name, allowing for a simple way to theme the standalones.

This component relies on two other things:

Usage

For use in React

import React from 'react'
import { ThemeSwitch } from '@ta-interaktiv/react-theme-switch'

function Component(props) {
  // The following component renders the page in the style of 'Das Magazin'
  return (
    <div>
      <ThemeSwitch mediaName='dasmagazin' />
    </div>
  )
}

As part of the constructor

import React from 'react'
import { ThemeSwitch as themeSwitch } from '@ta-interaktiv/react-theme-switch'

class Component extends React.Component {
  constructor(props) {
    super(props)

    themeSwitch({ mediaName: 'dasmagazin' })
  }

  render() {
    return <div>Your Component</div>
  }
}

Overriding the theme of a deployed project

It is also possible to override the theme of a already deployed project. Append the following query parameter to the URL: ?themeswitch=<mediaName>

Documentation

Can be found here.

2.1.1

1 year ago

2.1.0

1 year ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.0

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago