-
Notifications
You must be signed in to change notification settings - Fork 160
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
Add part
attributes to elements in the shadow DOM
#11673
Comments
@andy-blum followup question: would you want to apply this to C4IBM v1 because that's what AEM is currently on? Or were you thinking this would be applied to C4IBM v2 so when AEM does adopt (possibly soon?) it will enable this greater flexibility? |
Oh that's a great question. Let me find out when we plan on upgrading to v2. |
Sounds like updating to v2 is slated for mid-late Q2. We'd probably want to do some of this in v1 (the cta-block, for example is a current pain point), but we could probably limit how much we add in to v1. |
Here's another demo, this time modifying An important thing to remember if we do this is how context plays into the CSS Cascade: Styles encapsulated within the component that conflict with global styles are resolved at the context level. The order, specificity, and In my demo, I've applied |
@andy-blum thank you for your patience: Yes, let's move forward with the VersionsI assume you will apply this to C4IBM
Documentation:
Figma & design tooling
|
@oliviaflory Some general Figma thoughts —
|
Actually, I don't think we want to invest the time in doing this for v1 components. From what I've been told, AEM is looking at an upgrade to v2 near end of Q2. Personally, I'd like to avoid enabling AEM to stick around on an old version longer than needed. If this kind of flexibility motivates the powers that be to upgrade to v2, so be it.
There seems to be a way to do this already in the
Agreed, though I don't have a thought yet on the right wording for this.
I'm not sure this is necessary? The modifications are all controlled by code, and content authors won't be able to make design decisions that aren't explicitly given to them by developers. |
The problem
From time to time there is a need to navigate around styles encapsulated within components. For example:
Components that attempt to enforce spacing between their adjacent elements
Example: dds-cta-block
The dds-cta-block component adds padding to
:host
as well as to.bx--content-layout
. This ensures a certain amount of space between this component and another component added later. The problem, however, is that this spacing is prescriptive, and cannot possibly take into account every possible implementation of this component with every other component or with custom markup. While the padding on:host
can be overridden, the padding of.bx--content-layout
cannot.Components that have an ever growing list of variations
Example: cards, links/buttons, tiles
Some of our components are highly atomic. That is, they are rarely used in isolation and frequently present differently in different contexts. An example of this is the
caem-tile
component that we have in Carbon For AEM.caem-tile-group
on ibm.com homepage50-50-container
on ibm.com/consultingTHINK Spotlight
(proposed)The
caem-tile
component was originally built as a deliberate deviation fromdds-card
, and was designed for the use on the homepage exhibited above. New designs came forward that were very close to the original specs, but expanded the components internal spacing for the use in the consulting leadspace. At this time, we created a "double-tile" variant as a quick solution. Now, there is another proposed deviation from the orginal design for a more compact spacing in the proposed THINK spotlight designs.The solution
To avoid continually adding new variations to account for different sizing and spacing needs, we've opened up the shadowroots of CAEM components to styling from the AEM CSS Authors. This allows adopters to assume the responsibility of using components in a way that complies with the IDL and carbon specifications while using them in ways that original designs may not have accounted for. To see this in action, see this codepen demo
Instead of prescribing a limited set of variations and needing to handle new requests for new contexts, now AEM can maintain its own CSS that modifies the presentation of the components we've built. Instead of maintaining a "double-tile", authors can target
caem-tile
elements with a class or a parent selector and increase the spacing to satisfy their needs.Likewise, instead of building a new "compact" variant for THINK, we can simply maintain the base version of a tile and the adopters can modifiy the spacing to satisfy their needs.
One downside of this approach is that the carefully-crafted carbon-compliant styles we've started with can be completely overridden to create new non-compliant interfaces
The text was updated successfully, but these errors were encountered: