surface-ui / surface

A server-side rendering component library for Phoenix

Home Page:https://surface-ui.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting which modules can pass context values outside of config

Zurga opened this issue · comments

commented

Currently, SurfaceBulma uses contexts to pass variable class names to components in slots. This works great and allows the user to use components with flexibility. A Link used inside a Navbar will have the correct class set without the user thinking about it.

However, due to the fact that allowing a component to do this is set in the config, the user of SurfaceBulma has to either manually add this, or add import_config ../deps/surface_buma/config/contexts to their own config.

Although this is not a hurdle that cannot be overcome, for the sake of ease of use, it would be nice if there was another way to configure this setting.

Maybe there is an undocumented way that I have missed, but setting @propagate_context_to_slots_map directly on a Component does get rid of the warning, but the values are not passed on to the slot.