Staff++
latest
latest
  • Staff++
  • General information
    • Quick start
    • Reload Configuration
    • Multi Server Setup
    • General Configuration
    • Other
      • Text parsing
      • Styling the GUIs
        • Gui structure
        • Selectors
      • Configuring command hooks
  • Permissions & Commands
    • Commands
    • Permissions
      • Legacy permissions
  • Features
    • Alerts
      • X-Ray
    • Alt account detection
    • Authentication
    • Banning
      • IP Banning
        • Messages
      • Fixed Ban Reason
      • Templates
    • Blacklist
    • Broadcasting
    • Chat module
    • Chest/Inventory Interaction
    • Command detection
    • Examine players
    • Freezing
      • Command hooks
      • Luckperms integration
      • Chat channels
    • Infractions
    • Investigate
      • Command hooks
    • Join messages
    • Player IPs
    • Kicking
    • Muting
      • Appealing
    • Protection
    • Player information
    • Player notes
    • Reporting
      • Command hooks
      • Messages
      • Finding reports
      • Report types & Reasons
      • Chat channels
    • Staff Chat
    • Staff Mode
      • Multiple modes
      • Staff Modules
      • Custom Staff Modules
        • State dependent modules
      • Command hooks
      • Luckperms integration
    • Staff Locations
    • Teleporting
    • Vanish
      • Luckperms integration
    • Warnings
      • Quick start
      • Severity levels
      • Thresholds
      • Actions (punishments)
      • Appealing
      • Warning workflow
  • Web Platform
    • Register Players
    • Setup Web Platform
    • Architecture
  • Integrations
    • Discord Integration
      • Staff Chat
      • Template Packs
      • Customize Discord Templates
    • Trello Integration
    • PAPI expansion
      • PAPI Examples
  • Migration guides
    • Staff+ migration guide
    • Migrating to >=V1.16.43
    • Upgrading Discord Integration to 1.16.51
  • Developers
    • API guide
Powered by GitBook
On this page
  • Gui
  • Items
  • Lore line
  • Selecting and applying styling

Was this helpful?

  1. General information
  2. Other
  3. Styling the GUIs

Selectors

PreviousGui structureNextConfiguring command hooks

Last updated 3 years ago

Was this helpful?

Inside the style configuration files we need to use what we call "selectors" to try and select the correct for which we want to change the styling.

We basically have 2 ways of selecting a component.

  • By ID

  • By Class

Make sure to enable style information by executing /show-style-info

Ids are shown in red and classes are shown in green.

Gui

The ID of the GUI is shown before the title of the GUI

Items

Item id and classes are shown before the name of the item

Lore line

Ids and classes of the lore lines are shown below the line. Do note that one line inside the lore can consist of multiple parts. Each part is a component and thus can have its own ID and classes. If you see multiple ids next to each other it means there are multiple text parts.

In this example there are 2 text parts for this one loreline. One is the label "Reporter: " and the other one is the value "garagepoort".

Selecting and applying styling

We use the YAML file format for styling. Inside the styles directory we can create whatever yml config file we want and the rules configured in it will be picked up.

ID selection

report-detail:
    report-info:
        reporter-label:
            color: "&C"

The selector in the above case is: report-detail -> report-info -> report-label

Basically this means we are selecting a component with the id "report-label" which is part of another component with the id "report-info" which then again is part of a GUI with the ID "report-detail". We can see in the screenshot this will select part of the lore of the report information item.

Then we set the styling rules for this component by, in this example, setting the color of that specific part of the lore.

Class selection

report-detail:
    report-info:
        $detail-label:
            color: "&C"

The selector in the above case is: report-detail -> report-info -> $detail-label

Basically this means we are selecting any component that has the class "detail-label" which is part of another component with the id "report-info" which then again is part of a GUI with the ID "report-detail". We can see in the screenshot this will select multiple parts of the lore of the report information item.

The dollar prefix in $detail-label means we are selecting a class and not an ID.

Then we set the styling rules for this component by, in this example, setting the color of that those specific parts of the lore.

component