Extendind default theme: how to get rid of this blue outline around the button?


I’m extending the default theme based on the example provided on docs. While applying my new style to the buttons, I’ve noticed this light blue outline around it. I’ve tried setting outline to zero, but the outline still being shown.

What MCU/Processor/Board and compiler are you using?

lv_port_eclipse running on Clion

What LVGL version are you using?


What do you want to achieve?

Get rid of the light blue outline around my button

What have you tried so far?

lv_style_set_outline_width(&style_btn, 0);

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.

#include "ui_lvgl.h"

static lv_style_t style_btn;

static void new_theme_apply_cb(lv_theme_t * th, lv_obj_t * obj)

    if(lv_obj_check_type(obj, &lv_btn_class)) {
        lv_obj_add_style(obj, &style_btn, 0);

static void theme_md_dark(void)
    lv_style_set_bg_color(&style_btn, lv_color_hex(0x14816A));
    lv_style_set_radius(&style_btn, 0);
    lv_style_set_border_color(&style_btn, lv_color_hex(0x5FE2C0));
    lv_style_set_border_opa(&style_btn, 150);
    lv_style_set_border_width(&style_btn, 1);
    lv_style_set_shadow_color(&style_btn, lv_color_hex(0x181D1B));
    lv_style_set_shadow_opa(&style_btn, 150);
    lv_style_set_shadow_width(&style_btn, 3);
    lv_style_set_shadow_spread(&style_btn, 1);
    lv_style_set_shadow_ofs_x(&style_btn, 1);
    lv_style_set_shadow_ofs_y(&style_btn, 1);
    lv_style_set_text_color(&style_btn, lv_color_hex(0x5FE2C0));
    lv_style_set_outline_width(&style_btn, 0);

    lv_theme_t * th_active = lv_disp_get_theme(NULL);
    static lv_theme_t th_md_dark;
    th_md_dark = *th_active;

    lv_theme_set_parent(&th_md_dark, th_active);
    lv_theme_set_apply_cb(&th_md_dark, new_theme_apply_cb);
    lv_disp_set_theme(NULL, &th_md_dark);

void ui_init(void)
    lv_obj_t * btn;
    lv_obj_t * label;

    lv_theme_default_init(NULL, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED), true,


    btn = lv_btn_create(lv_scr_act());
    lv_obj_align(btn, LV_ALIGN_TOP_MID, 0, 20);

    label = lv_label_create(btn);
    lv_label_set_text(label, "PERF");


Screenshot and/or video

Screenshot from 2024-02-15 18-19-52