• It would be nice to have the option for icon only without the search box and when you click on the icon, it toggles to the box. Is there a workaround via code?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Kathryn Presner

    (@zoonini)

    Hi @alexgraphicd – there is an enhancement request for this feature but it has not yet been implemented in the Search block. There isn’t a simple way to do this on your own, but there might very well be a plugin that can, so I’d suggest taking a look to see if something might fit the bill.

    Hello @alexgraphicd
    I managed to do this with CSS:

    .wp-block-search__inside-wrapper
    .wp-block-search__input {
    background-color: transparent;
    background-image: url(insert the URL of your search icon here!);
    background-position: 5px center;
    background-repeat: no-repeat;
    background-size: 24px 24px;
    border: none;
    cursor: pointer;
    height: 37px;
    margin: 3px 0;
    padding: 0 0 0 40px;
    position: relative;
    -webkit-transition: width 400ms ease, background 400ms ease;
    transition: width 400ms ease, background 400ms ease;
    width: 0;
    }
    
    .wp-block-search__inside-wrapper
    .wp-block-search__input:focus {
    background-color: transparent;
    border-bottom: 1px solid #000;
    cursor: text;
    outline: 0;
    width: 200px;
    }
    .wp-block-search__label
    .search-form
    .search-submit{
    display:none;
    }
    
    ::placeholder {
    color: black;
    }

    Hope this helps! 😊

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Search block options’ is closed to new replies.