What is this in my Custom CSS field?

Krothos
Krothos

I have the following in my Custom CSS field:

          /* Sets the size for the Custom CSS text area */

               #custom-css-field.flat-field{

                    height: 1000px !important;}

When I remove it, nothing seems to change. Trying to remember why I had this here.... any enlightenment?

Thanks.

 

Comments

  • Bortas
    Bortas
    Posts: 645

    Yeah, someone on here posted it, and it was genious, we all latched on and forgot, thanks for the reminder!

    Its for the GM only, style, advanced section. It makes the place where you input CSS taller, instead of so short.

    -bort

  • Krothos
    Krothos
    Posts: 230

    Ah, that's what I thought. Of course, now it's working like that. hehe

     

  • cgregory
    cgregory
    Posts: 779

    If you want to get rid of the !important the full css for it is

    .campaign-settings #advanced-settings #custom-css-field{

    height: 1000px;

    }

    They are among us!

    image

                       XCom: Defiance - Campaign of the Month November 2016

     

     

  • Krothos
    Krothos
    Posts: 230

    Thanks for the suggestion. Is there a reason to remove !important? In other words, is using one CSS line better over the other?

  • cgregory
    cgregory
    Posts: 779

    Generally if you are using !important you are hitting the wrong css specificity to override the original css. This can cause you to have it also affect other parts of your site than what you intend.

    For example, there could be a .wiki-page #custom-css-field (there isn't but for this example lets assume there is). If you used the !important you'd be hitting both of them.  Using .campaign-settings #advanced-settings #custom-css-field you are telling it to only affect the custom-css-field found after an advanced-settings which is found after the campaign-setting class and leave the others alone.

    The other reason I prefer not using !important is that I can look at my code that has specificity and tell what exactly it is doing.  And where in OP's original code I can find their default values (if any) so I know how I changed it.

    Here is the code from OP

    .campaign-settings #advanced-settings #custom-css-field {

        height: 310px;

    }

    A quick look at the two tells me I've increased the height of the custom-css-field from 310px to 1000px.

    They are among us!

    image

                       XCom: Defiance - Campaign of the Month November 2016

     

     

  • Abersade
    Abersade
    Posts: 261

    That was my code, shared is so folks could have an editing window that wasn't tiny by default.

  • Krothos
    Krothos
    Posts: 230

    @Abersade - Thank you for originally providing it. It's extremely helpful.  :)

     

  • weasel0
    weasel0
    Posts: 433

    Was that to alter the original box or for when the pages kept loading completely collapsed boxes?

  • cgregory
    cgregory
    Posts: 779

    To alter the original box.

    They are among us!

    image

                       XCom: Defiance - Campaign of the Month November 2016

     

     

Sign In or Register to comment.

May 2022
Revenge on the Kraken's Bane

Read the feature post on the blog
Return to Obsidian Portal

Howdy, Stranger!

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

Discussions