Not Solved Using both sprites and custom images..
#1
Not Solved
Hi, would it be possible for me to use both sprites and custom images as buttons for a theme?

I ask because I am ok with using the sprites for the postbit buttons and other icon images for my theme, but the only images I want to replace are the buttons for add reply, etc.

I came across an old tutorial for replacing the sprites with images, however, it requires me to change this:

a.button span {
    padding-left: 20px;
    display: inline-block;
    background-image: url(images/buttons_sprite.png);
    background-repeat: no-repeat;
}

a.button.new_thread_button span {
    background-position: 0 -340px;
}

a.button.new_reply_button span {
    background-position: 0 -360px;
}

a.button.closed_button span {
    background-position: 0 -380px;
}

to this:

a.button span {
    padding-left: 20px;
    display: inline-block;
}
a.button.new_thread_button span {
    background: url('images/buttons/new_thread.png') no-repeat;
}
a.button.new_reply_button span {
    background: url('images/buttons/new_reply.png') no-repeat;
}
a.button.closed_button span {
    background: url('images/buttons/closed.png') no-repeat;
}

I understand that the buttons that come after this are the others that use the sprite images much like in the first code, however the only buttons I like to change are for the ones for the topic itself. Currently, the buttons are using a background image and are using a font for both the text label and font awesome for the icons themselves. I would like to replace both removing the label and icon, but ONLY for the New Topic, New Reply and Closed buttons only while using the sprites for everything else.

Is there a way I can do this without it negatively affecting the other images above? I figured that it would be best if I ask first, rather than chancing on messing something up trying to do so..

Thank you in advance for the help.
Thank you in advance for your time, and as always I appreciate any help offered.

List of unsolved MyBB Support issues.. 

https://community.mybb.com/search.php?ac...&uid=81844
Reply
#2
Not Solved
If I understood your problem correctly then you only need change postbit template and add a custom class name to that buttons and define that class in your theme Stylesheet (like golbal.css or other css that attched to showthread page only if you want use this style only in showthread) and you can use sprites  image or a image as background for that button
Reply
#3
Not Solved
Thank you for the reply, I appreciate it.

That being said, I have no idea on how to do this as I am not a coder..

Are you saying that there is no way to disable the sprites only for the 3 buttons I mentioned while only using them everywhere else?

I ask because I am converting my older themes to be more mobile friendly and have those buttons made already that match the theme itself.
Thank you in advance for your time, and as always I appreciate any help offered.

List of unsolved MyBB Support issues.. 

https://community.mybb.com/search.php?ac...&uid=81844
Reply
#4
Not Solved
if you do not know what are you doing , So it's better not to change anything and give it to someone who knows what they're doing. 
if I want give you a example :
if you have a element like this
<span class="myclass">button</span>
and style is like
.myclass {
...
background: url('images/buttons/closed.png') no-repeat;
...
}
you have two way =>
first add a unique classname to that element like
<span class="myclass newclass">button</span>
then overwrite background atrributes like this :
.newclass{
...
background: unset !important;
...
}
or replace current class with new classname like
<span class="newclass">button</span>
then in new class name add all css atrributes except background
.newclass{
...
...
}

and if you not know do this and you want only disable background attribute for this element you can add as inline code too like this
<span class="myclass" style="background: unset !important;">button</span>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)