Enhancement: `spo page section add` extend *zoneEmphasis* option to handle images
Hi, in the latest updates of SharePoint Online, there's a new feature allowing you to set different types of section backgrounds.
Here are the options that I can see in the page source when the background image option is used.
| Option | Values |
|---|---|
| --zoneEmphasis [zoneEmphasis] | None, Neutral, Soft, Strong, Image,Gradient (the new ones) |
| --isCollapsibleSection | Set section to be collapsible |
| --showDivider | Show divider line between sections |
| --iconAlignment [iconAlignment] | Expand/collapse icon alignment |
| --isExpanded | Set default display of collapsible section |
| --gradientText [gradientText] | Set gradient setting of a section |
| --imageUrl [imageUrl] | Background image URL (if skipped, the default one will be set) |
| --imageHeight [imageHeight] | Background image height |
| --imageWidth [imageWidth] | Background image width |
| --fillMode [fillMode] | Fill mode of an image. Possible values are ScaleToFill, ScaleToFit, Tile, OriginalSize |
| --useLightText | Use light text parameter for background |
| --overlayColor [overlayColor] | Overlay color for background |
| --overlayOpacity [overlayOpacity] | Overlay opacity for background |
Is it worth adding so many new parameters for this single option? Perhaps you have any recommendations regarding this matter. I will also explore the gradient option; maybe some parameters could be shared (like overlay ones).
And if you don't mind, I can take on this task, as I have already conducted some research.
That would be a great enhancement. We definitely need to validate gradients too. If we're adding background images, we should consider gradients as well. Adding all these options to spo page section add seems like the best approach. We could also use spo page section background set, but that feels a bit overkill. One more feature I'd like is setting a focus point for the image. It's not the easiest to define, but it's quite interesting.
@mkm17 awesome suggestion:
- I am also fine in adding those as additional/new options. We already have commands with a looot of options like spo site set
- what should be the possible options for
overlayColor? white/dark? - BTW I think we also don't have options to define it as collapsible and the following 😉. Why don't we try to tackle those as well? Also since those are not 'that new' 🙂
@Jwaegebaert, thank you for the comment. I will then check the gradient option and extend the specification of the command. Regarding the focus, I believe it may need to be handled by the height and width parameters, but I am not sure how to handle it.
@Adam-it, ok, I will check how it is set and add it to the specification 😄 The overlayColor can be provided in #rrggbb format
Hi, I have updated the specification. The settings for the collapsible section and gradient background have been added. :)