using import url will it protect my css code - css

I've been target for someone used to copy my website style sheet so this time i would like to protect my css file using the following :-
i will create fake.css and inside it will put the following code based on #import url
#import url("css/real.css");
Now if he view source will only see the above line and will try to call
www.my_site.com/css/real.css
but i will indeed using my hosting panel will not allow direct access to files .css
Now my question, Is it save enough or still he can get the code by using firebug or whatever !? ~ thanks

There is no way to hide CSS from your users.

Related

Css file doesn't affect after editing in SharePoint Online

I has a css file named styles.css and it was loaded in masterPage of sharepoint .I change this css file but not working. I make sure this css file already loaded in html page.I also clear cache but I don't know why it doesn't affect when I edit. Please help me, thank you so much!
It is not recommended to modify the online master page directly.
Firstly, you need to check if the CSS file is really imported.
Secondly,if the file is not imported, classic page you could upload CSS here.
modern page we should upload CSS with SPFX,here is a tutorial: https://github.com/hugoabernier/react-application-injectcss.
If the file is imported, first check whether the content of the file is displayed normally (excluding problems caused by encoding), then you can add ‘! Important’ after the style.

How to alter CSS files inside aikau-1.0.101.10.jar in Alfresco

I was working on translating Alfresco share to Arabic i.e to RTL format.
Reading a comment from here I found out that the best way to proceed is to Create a custom extension pulling in an additional CSS file with the styling modifications.
Now coming to the question, I've encountered a problem while altering the css files to support RTL. The problem was that some css files were situated inside aikau-1.0.101.10.jar file. Can anyone help me on how to alter these css files ? or Can I override these files somehow ?
Some ways to do this:
You can create your own theme
Override LESS variable link
Fork Aikau and build your own jar link
Create an extension to include your own css file link

EJS Tags in external css

I'm trying to refactor a nodeJs project and my css is in my .ejs file. I need to put some dynamic data in my css file. I need to have dynamic data in my css, when my css is in my EJS file it's good.
But when I put my css into an external file, nothing happens!
So, how can I inject ejs tag in my external stylesheet file?
This is one of the questions to which one has to ask you - why do you want to do that? You are asking about a solution to a problem that you didn't describe.
By suspicion is that you are trying to use a templating system for something that could be done with a CSS preprocessor like Sass or Less. Particularly Less can be easily used on both the client side and server side. See http://lesscss.org/#client-side-usage
Now, if you really want to use a templating system created for HTML to generate CSS then you will have to take few things into account: You need to store your CSS templates somewhere where your HTML templates are stored, not where you store your static assets like images. Then, your server will have to serve your generated CSS with a correct MIME type. Then, your HTML will have to reference the styles using a URL to your generated CSS that will be generated on every request instead of being served directly from disk.

Dynamic css file Server Error (Wordpress)

my theme uses a dynamic css file 'custom-style.php' which is included through wp_enqueue_style();
This file includes some styles depending on the theme options (colors,fonts,...)
On some installation there is no access to this file. Trying to access the file via the source code gets a "500 Internal Server Error". Changing file permissions to 777 does not solve it.
How can I solve this? Is there any other possibility to create dynamic css files?
Alternatively I could write a function to include this css in the head of the html but this is not the way I want go. There are some lines of css and I don't like css in html output.
This problem is from the server and is related to the server configuration. You can put your css code in variable and use the file_put_contents function to put your css code into the style.css file.
Like the code below
<?php
$customColor = #fff;
$css_code = "body{ background:{$customColor}; }";
file_put_contents('style.css',''); //First we empty the file
file_put_contents('style.css',$css_code);//Transfer Css code to file
I used this method and it was a good solution

CodeIgniter CSS files

I have a designer who makes the design for me and I want to start with CodeIgniter.
But the problem is to place the CSS and images file. I can put them in the root of the application but it is not supported in IDE (DW).
What I mean is the path is not working in DW to show CSS styling in live view and my designer can't make change without seeing styling.
I would also like to enable the intellisense feature on DW if possible.
Any help will be helful. Thanks.
You shouldn't rely on DW. The quickest thing you can do is to render him a HTML page which he can open and edit and DW, and then just copy the CSS changes to your CI project.
I always save CSS files in the root directory. That way, I can quickly access them using the shortest of paths inside CI's URL helper functions.
Such as...
echo site_url('css/style.css');

Resources