v2 Custom Field Render

How can I use/access styles from the Design System?

I want to apply a style from Design System on a button I created with Custom Field Renderer.



Code:

const FieldRenderer = skuid.component.FieldRenderer;

return new FieldRenderer({

    readModeStrategy: "virtual",

    read: function (fieldComponent) {

        let h = fieldComponent.h,

            context = fieldComponent.cpi.getContext();

            let { element, field, model, row, value } = context;

        

        let childNodes = [];

        childNodes.push(

            h("button", {

                onclick(event){

                    console.log('click1');

                }

            }, [

                `+`,

            ]));

        if(row.Added_By_User__c){

            childNodes.push(

            h("button", {

                onclick(event){

                    console.log('click2');

                }

            }, [

                `-`,

            ]));

        }

        return h('div', {}, childNodes);

    },

});

Answers

  • Hi Lukas,

    Were you able to determine how to apply the style with your custom renderer?

  • Hi Ben,

    Thanks you for the reply.

    Unfortunately, it's not possible to apply DSS styles on Custom Components, hence will have to re-write the styling in the code.

    Best

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!