Have you tried copying and pasting the syntax from my original example above. It already has the correct syntax.
Your latest update fixed the space between .tile and .hyperlink but it looks like a new error was introduced. There should be a space after .tile.hyperlink and the .icon
Again, the original post had valid syntax that you could highlight and copy.
That snippet is specifically for Hyperlink tiles. The .tile.hyperlink part indicates that it should only apply to hyperlink tiles. You would need to adjust accordingly if you wanted it to apply to other tile types.
I mean that the snippet only applies to Hyperlink tiles. Not any other tile like Things, Variables, etc. It being a built-in icon versus a uploaded file image shouldn’t matter in this case since we are targeting the higher level .icon
As mentioned in my previous reply, it’s the combination of .tile.hyperlink in the CSS selector that does this.
Your existing CSS uses the same approach to limit the CSS to news feeds, clocks, and calendars.
If you can clarify what you are trying to accomplish, perhaps we can provide better guidance. Just a heads up that I am out of the office on vacation, so might not be able to respond immediately, but other community members might be able to help out in the meantime.
PS. You will want to make sure the selector is all on the same line as shown in my original snippet. The screenshot just made it look like it was on two lines since my browser developer tools squished things a little bit.
@josh ,
As mention above I’m trying the change the position of a File Type Icon.
I’m trying to move the icon a little bit down since it cover my header.
The snippet only applies to hyperlink tiles. As I mentioned in my previous reply, you have a variety of different types of css selectors in your theme.
All of the ones highlighted in yellow are targeting a particular tile type. In other words, the CSS with those only applies to a particular tile type / layout.
The ones highlighted in blue are targeting specific named styles and only apply to tiles that use that particular named style.
The ones in red don’t have any subselector, so they apply to the icons of ALL tiles.
You would need to adjust the snippet according to your needs. Are you trying to apply the style to ALL tiles, all Color Control tiles, or just a particular tile (eg. With a specific named style)?
Now I got you… Sorry I’m not as smart as you when it comes to CSS…
I manage to fix and move the position of my icon. My solution is remove the Hyperlink and add img :
Reviving this thread. This addresses setting the tile size for all types of icons - user added and system. This is not ideal as I use the same styles for tiles that contain both types of tiles. I presume there is no way to know this is a custom tile? If so, it seems that by default the system is picking a base size for custom tiles that is smaller than built-in icons. I don’t suppose there is anyway to bump this up across the board? Thanks.
Can you clarify what you mean by this? Did you mean that you are using a SharpTools Custom Tile with Custom HTML? In the case of a Custom Tile, the rendering of the tile happens in its own sandboxed context and the developer of the Custom Tile is fully responsible for the layout and sizing of various elements within the Custom Tile.
Since it’s rendered in a sandbox, Custom CSS from the Dashboard level can’t reach inside the sandbox of the Custom Tile. But the Custom Tile itself could be modified with HTML or CSS as desired.
You can target both system icons and custom image icons as @GrooveENERGY_ca showed here.
While they showed targeting each of these icon types separately, CSS allows you to use comma separated list of selectors. So with Groove Energy’s example, if you wanted to apply the same adjustments to both types, it could be combined like:
/* All on one line */
.tile .icon svg, .tile .icon img { /* your adjustments here */ }
/* Or separated so it's easier to read */
.tile .icon svg,
.tile .icon img {
/* your adjustments here */
}
My bad. I thought one thing and wrote another. I should have said custom icon.
The solution above is to change the size of the image. But for some reason all custom icons display smaller than built-in icons. So if I change the size of the image on a custom icon then it impacts all images with that specific tile.
Now that I am typing this the obvious solution is to create two styles - one for custom icon and one for regular icon.
But any specific reason why custom icons appear smaller? Thanks.
In the first photo, it might not be immediately obvious, but the mower icon is effectively taking up the full width of the default space available to the icon… and the Tesla logo is taking up the full height.
I added the red dashed outline to the img/svg tag to show the available space for an icon and make it more apparent.
Width Restricted: Mower
The mower icon uses an aspect ratio that’s wider than the 4:5 ratio, so as it fills the space it gets restricted by the available width of the icon container.
Height Restricted: Tesla
The Tesla icon, on the other hand, is taller than the 4:5 ratio, so as it fills the space it gets restricted by the available height of the icon container.
A critical point is that the mower image does not have any padding in the image itself – it fills the width available.
If I used an image that had padding rendered into the image itself, then the icon will appear smaller though the actual image is doing the same thing as before filling up the available height or width first depending on its aspect ratio. As such, you should make sure your uploaded images do not have any padding if you want them to take up the full space.
Follow-up on this - I have noticed that some custom icons appear lower in the tile. I think this is because I am using a custom style but I can’t figure out how to adjust this. The example below uses a system icon on the left and the custom icon on the right. Both are using the same style. I have included the style commands in case there is something there that is causing this to happen? Thanks.