XF 1.5 Responsive BBCode with argument

ForestForTrees

Well-known member
Okay, this is a moonshot.

Is there some CSS wizardry that will allow me to do the following:

I'd like to make a BBCode called mobile size that replaces the following
Code:
[msize={option}]Introduction[/msize]

with
Code:
<span style=font-size:{option}%;>Introduction</span>

However, it only does so when the screen size is below 400px.

Set aside security concerns for a moment. Is this possible?

Media queries can't be inline.
 
Never mind. Figured it out. Here is the HTML replacement. Pretty cool:
Code:
<span>
  <style scoped>
    @media (max-width: 500px) {
      .on-the-fly-class-{option} {
        font-size: {option}%;
      }
    }
  </style>
<span class="on-the-fly-class-{option}">{text}</span>
</span>
 
Last edited:
Top Bottom