Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ta-interaktiv/react-theme-switch

Package Overview
Dependencies
Maintainers
5
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ta-interaktiv/react-theme-switch

Loads an additional stylesheet based on the domain name to allow for simple theming.

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20
decreased by-70.59%
Maintainers
5
Weekly downloads
 
Created
Source

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:

  • Stylesheets to be found under interaktiv.<publicationName>.ch/static/themes. These stylesheets should define fonts and all the necessary overwrites for a specific publication. The repository with the stylesheets is located here: https://gitlab.com/ta-interaktiv/tamedia-publication-themes
  • Our version of Semantic UI that's using generic font names (TamediaUI, TamediaText, TamediaDisplay, TamediaChart). This is available from version 3 on. The repository for Semantic UI is here: https://bitbucket.org/tagesanzeiger/ta-semantic-ui/src/master/

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.

Keywords

FAQs

Package last updated on 21 May 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc