Code Monkey home page Code Monkey logo

csh-material-login's Introduction

CSH Material Login

A Keycloak material theme for Computer Science House.

Installation

Run yarn build to build the theme in production mode and generate the theme archive, which will be saved to dist/csh-material-login_v2.x.x.jar. Then, deploy it to your instance of Keycloak.

Contributing

Clone this repo and make sure you have:

Install the dependencies by running yarn.

To set up a local instance of Keycloak for development, install Docker, then, from the project root, run docker-compose up -d to build and run the development container. Once the container is up and running, run yarn start to compile the theme and start watching the source files for changes. All source files can be found in the appropriately-named subdirectory under src.

Keycloak will be available at http://127.0.0.1:8080. The username and password for the default administrative user are both admin. Once logged in, change the Login, Account, and Email themes to csh under the Themes tab on the Realm Settings page, then log out to see the theme.

To stop the container, simply run docker-compose down from the project root.

Creating a Theme

Just here to add a theme to the gallery? Simply create a folder in src/login/resources/themes named with a unique ID for your theme (lowercase alpha-numeric, no spaces), add any resources that your theme requires, and create a theme.json that describes your theme. Take a look at the existing themes for an example. The supported options are:

  • id: The unique ID for your theme, same as its folder name.
  • name: A printable name for your theme that will appear in the theme gallery.
  • authorUsername: The theme author's username.
  • authorName: The theme author's name.
  • dark: Indicates the theme has a dark background and should use "dark mode" assets in the foreground
  • stylesheets: An array of stylesheets URLs (either absolute or relative to the theme) to be loaded with the theme.
  • background: Configures the page background.
    • color: A hex or RGB color value. Maps to the CSS background-color property.
    • image: A CSS image value. Maps to the CSS background-image property.
    • size: One of auto|length|cover|contain|initial|inherit. Maps to the CSS background-size property.
    • repeat: One of repeat|repeat-x|repeat-y|no-repeat|initial|inherit. Maps to the CSS background-repeat property.
  • backgroundUrl: A convenience property to set a background image that will cover the page. Should simply contain an absolute URL to the background image or a path relative to the theme directory.
  • logo: A custom logo to replace the default CSH logo. Should contain an absolute URL to the logo image or a path relative to the theme directory.

Example from the gradient theme:

{
	"id": "gradient",
	"name": "Gradient",
	"authorUsername": "smirabito",
	"authorName": "Steven Mirabito",
	"dark": true,
	"background": {
		"color": "#b0197e",
		"image": "linear-gradient(#430a30, #b0197e)",
		"size": "cover",
		"repeat": "no-repeat"
	}
}

csh-material-login's People

Contributors

dependabot[bot] avatar devinmatte avatar ethanf108 avatar joeoneil avatar mstrodl avatar oztaco avatar sgreene570 avatar shawnrc avatar stevenmirabito avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

csh-material-login's Issues

Theme Tile Resizing

Right now when you have a theme tile where either the author or theme name itself gets longer than the average, the theme pushes the blocks around a little unintuitively.

Name Issues

IE and some older browsers don't support Array.prototype.find()

We use the Array.prototype.find() method to search for a theme in the gallery manifest when we load state from localStorage. We should include the polyfill for this method to add support for IE and some older browsers.

https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find

https://sentry.io/csh/keycloak-login/issues/251871883/

None: Object doesn't support property or method 'find'
  at None (/resources/3.0.0.final/login/csh/js/themes-2a63a3c859.js:25)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.