-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH Allow status flags to be used generically #1856
base: 3
Are you sure you want to change the base?
ENH Allow status flags to be used generically #1856
Conversation
Take styling for versioned badges in their various places and centralise it as a more generic badge, plus ensure LeftAndMain breadcrumbs include status flags
672dc69
to
2654029
Compare
background-color: $color-notice; | ||
border-color: transparent; | ||
color: $body-color-dark; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These colours are fairly arbitrary but look nice as a default IMO. Only custom flags will use this styling, all of the versioned/fluent flags still use the colours they used to use.
span.badge.status-modified { | ||
color: $state-draft; | ||
} | ||
|
||
span.badge.status-addedtodraft { | ||
color: $state-draft; | ||
} | ||
|
||
span.badge.status-deletedonlive, | ||
span.badge.status-removedfromdraft { | ||
color: #636363; | ||
border: 1px solid #E49393; | ||
background-color: #F2DADB; | ||
} | ||
|
||
span.badge.status-workflow-approval { | ||
color: #56660C; | ||
border: 1px solid #7C8816; | ||
background-color: #DAE79A; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were moved into the relevant modules - versioned-admin and advanced-workflow.
// Badges with no text aren't displayed | ||
&:empty { | ||
display: none; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This already gets inherited from bootstrap, but it surprised me at first. Adding it here so it's explicitly intended behaviour.
Fluent relies on this for something that probably shouldn't be using status flags but I don't want to widen the scope to unpicking that right now.
// align back button and breadcrumbs | ||
// but specifically do NOT override badge display | ||
*:not(.badge) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required to respect the display:none
on empty badges.
Status flags are made generic in silverstripe/silverstripe-framework#11460
This PR generalises the styling for them across the board, and ensures
LeftAndMain
classes always show badges in the breadcrumbs.Styling in
CMSMain
looks like this:Custom flags look like this (but custom styling can be easily added):
Status flags in gridfields look like this:
Issue
SiteTree
inCMSMain
silverstripe-cms#2947