Skip to content

Mastodonインスタンスで利用可能な、Google+風のCSSテーマ

License

Notifications You must be signed in to change notification settings

GenbuProject/GPlusTheme-for-Mastodon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google+ Theme for Mastodon v1.1

Languages

Overview

This theme replaces WebUI of any Mastodon instances with Google+ like one.

Requirement

Installation

  1. Follow the official guide and add this theme

    1. Copy these files in src of this repository into app/javascript/styles of Mastodon source directory

      • /gplus-theme-for-mastodon/
      • /gplus-theme-for-mastodon.scss
    2. Add the below code on config/themes.yml

      default: styles/application.scss
      contrast: styles/contrast.scss
      mastodon-light: styles/mastodon-light.scss
      # Maybe there are other themes...
      
      google-plus: styles/gplus-theme-for-mastodon.scss # Insert this one into any lines
    3. Add localization data to config/locales/{lang}.yml (At least config/locales/en.yml is REQUIRED)

      themes:
        contrast: High contrast
        default: Mastodon
        mastodon-light: Mastodon (light)
        # Maybe there are other themes...
      
        gplus-theme-for-mastodon: Google+ # Insert this one into the below line
  2. To avoid CSP(Content Security Policy), MAKE SURE to change config/initializers/content_security_policy.rb :

    base_host     = Rails.configuration.x.web_domain
    assets_host   = Rails.configuration.action_controller.asset_host
    assets_host ||= "http#{Rails.configuration.x.use_https ? 's' : ''}://#{base_host}"
    
    Rails.application.config.content_security_policy do |p|
    p.base_uri        :none
    p.default_src     :none
    p.frame_ancestors :none
    p.font_src        :self, assets_host, google_font_host
    p.img_src         :self, :https, :data, :blob, assets_host
    p.style_src       :self, :unsafe_inline, assets_host
    p.media_src       :self, :https, :data, assets_host
    p.frame_src       :self, :https
    p.manifest_src    :self, assets_host

    into

    base_host     = Rails.configuration.x.web_domain
    assets_host   = Rails.configuration.action_controller.asset_host
    assets_host ||= "http#{Rails.configuration.x.use_https ? 's' : ''}://#{base_host}"
    google_font_host = "https://fonts.gstatic.com"
    gplus_theme_host = "https://raw.githubusercontent.com"
    
    Rails.application.config.content_security_policy do |p|
    p.base_uri        :none
    p.default_src     :none
    p.frame_ancestors :none
    p.font_src        :self, assets_host, google_font_host, gplus_theme_host
    p.img_src         :self, :https, :data, :blob, assets_host, gplus_theme_host
    p.style_src       :self, :unsafe_inline, assets_host, gplus_theme_host
    p.media_src       :self, :https, :data, assets_host
    p.frame_src       :self, :https
    p.manifest_src    :self, assets_host

Screenshots

Overview on Google Chrome@Windows 8.1(64bit)

Account on Google Chrome@Windows 8.1(64bit)

Setting on Google Chrome@Windows 8.1(64bit)

Account on Google Chrome@Nexus 5X