• Resolved Spacetime

    (@spacetime)


    It seems the plugin removes some custom CSS selectors.

    Pages have dynamically generated content.
    On normal page the generated CSS code is left untouched and works fine, however on AMP pages some selectors are missing and the page is not displayed properly.

    Tested on development server which is not public.

    How can I prevent removing CSS selectors?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Can you tell us which CSS is removed?

    Please give us some more details so that we can help you.

    Thread Starter Spacetime

    (@spacetime)

    I have tens of CSS selectors. Some get removed – they are not present on AMP page.

    For example, I insert this style via amp_post_template_css hook:

    .ai-debug-display-none {display: none}
    .ai-debug-block pre {margin: 0; padding: 2px 5px 2px; line-height: 14px;}
    pre.ai-w3tc-debug {font-size: 12px;}
    pre.ai-w3tc-debug.ai-w3tc-run {color: #00f;}
    pre.ai-processing-log {padding: 10px; background: #eee; color: #000; font-family: monospace; font-size: 12px; line-height: 18px; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;}

    On AMP page some styles are missing, for example pre.ai-w3tc-debug:

    .ai-debug-block pre{margin:0;padding:2px 5px 2px;line-height:14px}pre.ai-processing-log{padding:10px;background:#eee;color:#000;font-family:monospace;font-size:12px;line-height:18px;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word}

    Plugin Author Ahmed Kaludi

    (@ahmedkaludi)

    Can you please tell me are you enable the ‘Optimize CSS(beta)’ option in AMP? If you are enabled, for checking purpose please disable that ‘Optimize CSS(beta)’ option and check once whether the same issue having or not.

    AMP-> Settings-> Performance-> Optimize CSS(beta)

    Thread Starter Spacetime

    (@spacetime)

    The option was enabled.
    When I disable it the selectors are not deleted and the AMP page looks as it should.

    What does the optimization do?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Some custom CSS selectors get removed’ is closed to new replies.