<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Bartlomiej Witkowski on Medium]]></title>
        <description><![CDATA[Stories by Bartlomiej Witkowski on Medium]]></description>
        <link>https://medium.com/@witkowski.bartlomiej1?source=rss-59013506d0bb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*E35e0QKLZ15fcjLWkYnMIQ.jpeg</url>
            <title>Stories by Bartlomiej Witkowski on Medium</title>
            <link>https://medium.com/@witkowski.bartlomiej1?source=rss-59013506d0bb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 08:16:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@witkowski.bartlomiej1/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Why I prefer Laravel over .NET]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@witkowski.bartlomiej1/why-i-prefer-laravel-over-net-36a93af8bbc9?source=rss-59013506d0bb------2"><img src="https://cdn-images-1.medium.com/max/1256/1*Zmun2-EIIQ39VReSRdvgUw.png" width="1256"></a></p><p class="medium-feed-snippet">It is my real life story, not next AI generated comparison..</p><p class="medium-feed-link"><a href="https://medium.com/@witkowski.bartlomiej1/why-i-prefer-laravel-over-net-36a93af8bbc9?source=rss-59013506d0bb------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@witkowski.bartlomiej1/why-i-prefer-laravel-over-net-36a93af8bbc9?source=rss-59013506d0bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/36a93af8bbc9</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[visual-basic]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Bartlomiej Witkowski]]></dc:creator>
            <pubDate>Thu, 13 Feb 2025 15:34:07 GMT</pubDate>
            <atom:updated>2025-02-13T15:34:07.937Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Modern PHP development with DDEV.]]></title>
            <link>https://medium.com/@witkowski.bartlomiej1/modern-php-development-with-ddev-23a65d77eae9?source=rss-59013506d0bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/23a65d77eae9</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[tools-for-developers]]></category>
            <category><![CDATA[php-development]]></category>
            <dc:creator><![CDATA[Bartlomiej Witkowski]]></dc:creator>
            <pubDate>Mon, 06 May 2024 12:20:46 GMT</pubDate>
            <atom:updated>2024-05-06T12:20:46.212Z</atom:updated>
            <content:encoded><![CDATA[<p>Forget about MAMP and XAMP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*O1Ufavm6E0zu2YMG" /><figcaption>Photo by <a href="https://unsplash.com/@benofthenorth?utm_source=medium&amp;utm_medium=referral">Ben Griffiths</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>There’s no magic bullet when it comes to picking an operating system for development. Each one has its pros and cons. I’ve been using Ubuntu to build web apps with the LEMP stack (that’s fancy talk for Linux, Nginx, MySQL, and PHP). It’s been working well for me, but there are definitely other options out there!</p><p>A lot of people is installing PHP, MySQL or Node locally on their hosts machines, while it’s working and it’s easy for beginners — it’s definitely not best solution. What if we need to change PHP version on the one of our projects or install project specific PHP packages which conflicts with others?</p><h3>PHP development on Ubuntu</h3><p>I love work on Ubuntu, but there are some challenges. One of them is design collaboration. Our agency uses Adobe XD, which is not available for Ubuntu, so I’ve been running Windows in VirtualBox. It works, but let’s be honest, it’s not the most elegant solution.</p><h3><strong>PHP development environment on macOS</strong></h3><p>I have been wondering a lot for change to Apple one operating system. It’s also Unix and offers ZSH which is very close to BASH. It has also a much better support for many other desktop apps than Ubuntu.</p><h3>PHP development environment Windows and WSL2</h3><p>I’m actually not a big fan of Windows, but honestly, Windows 11 and WSL2 are a game changer.</p><p>WSL2 stands for Windows Subsystem for Linux. It allows you to run Ubuntu (or other Linux distributions) directly on your Windows machine without needing a dual boot setup or a clunky VirtualBox window. It’s like having two operating systems in one, seamlessly integrated. You can even access your Windows files from the Bash terminal and vice versa.</p><p><a href="https://learn.microsoft.com/en-us/windows/wsl/install">You can read how to install WSL2 here.</a></p><h3>What is DDEV?</h3><p>This is a tool that helps set up a development environment in minutes. Under the hood, it uses Docker to build containers with all the dependencies you need for development. This means you don’t need to install anything directly on your host machine. It has great support for the most popular PHP frameworks and can also work with your custom projects.</p><p>I learned Docker myself and even created a local development tool, but it was time-consuming. Once I tried DDEV, I simply switched to using it. It truly solves a lot of common tasks, like setting up SSL on your local machine.</p><p>Check out this guide to get started: <a href="https://ddev.readthedocs.io/en/stable/">https://ddev.readthedocs.io/en/stable/</a></p><h3>How to use it?</h3><p>Once you have DDEV ready on your machine, you can just navigate to your project and write following:</p><pre>ddev config</pre><p>Then you need to write some configuration details, project name, web root folder and project type. Then just start with:</p><pre>ddev start</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g-TZzsVxoN9IwXFgP3Phdw.png" /></figure><p>Voila! You can reach your project in <a href="https://myproject.com.ddev.site/">https://myproject.com.ddev.site</a></p><h3>Deep dive</h3><p>If you need to customize your environment you can easy edit NGINX config</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*in_7g7-XjXsMLOu1myuKTw.png" /></figure><p>You can change the PHP version, database engine, Composer, or NPM version in the config.yaml file. This provides a lot of flexibility and removes the risk of conflicts with other packages because all files are contained within Docker containers.</p><h3>Thanks for reading!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23a65d77eae9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I got a job as web developer in Norway]]></title>
            <link>https://medium.com/@witkowski.bartlomiej1/how-i-got-a-job-as-web-developer-in-norway-aefcce612408?source=rss-59013506d0bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/aefcce612408</guid>
            <category><![CDATA[first-job]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[norway]]></category>
            <dc:creator><![CDATA[Bartlomiej Witkowski]]></dc:creator>
            <pubDate>Thu, 07 Mar 2024 10:47:11 GMT</pubDate>
            <atom:updated>2024-03-07T18:03:59.629Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GPHvsPQ-PiwkmEcE" /><figcaption>Photo by <a href="https://unsplash.com/@cgower?utm_source=medium&amp;utm_medium=referral">Christopher Gower</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Have you ever wondered how to become a web developer in Norway? In this post, I share my story and tips which can help you land your first web developer job in Norway!</p><h3>Norway</h3><p>Norway is a beautiful country in northern Europe. Imagine tall mountains, long coastlines with fjords (like long bays cutting into the land), and even islands way up north in the Arctic! Many Norwegians love the outdoors, and it’s a great place to see the Northern Lights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KLca5ALG1ANtVYj9" /><figcaption>Photo by <a href="https://unsplash.com/@starpollen?utm_source=medium&amp;utm_medium=referral">Mikita Karasiou</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>However, I didn’t come to Norway to see the fjords, although they are beautiful. I came here for family reasons.</p><h3>Work-life balance as a developer in Norway</h3><p>In Norway, family time is highly valued. For those who like spending quality time with loved ones and pursuing hobbies and personal interests, Norway offers an ideal environment.</p><h3>My story</h3><p>Landing in Norway as a young man, I transitioned straight into adulthood as a freshly graduated IT technician. Unfortunately, the language barrier and lack of connections made finding IT work a challenge. So, for several years, I took on jobs in various industries, from construction to warehouse work. I felt that my live went in wrong way, so I decided to get my dream job as web developer!</p><p>To see which technologies were most in demand, I conducted a market survey. Interestingly, most job postings for developers seemed to focus on the Java and C# tech stacks. This was entirely unexpected for me, as I had learned PHP as backend language in school.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*la8y3TGisRZKRo8W" /><figcaption>Photo by <a href="https://unsplash.com/@lucabravo?utm_source=medium&amp;utm_medium=referral">Luca Bravo</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I decided to refresh my knowledge of HTML, CSS, PHP, and JavaScript. As expected, it was absolutely fantastic to jump back into programming! I’ve been dedicating every free minute, evening, and weekend to learning.</p><p>I knew that it is important to have a portfolio and/or Github account with hobby projects. This is especially valuable for aspiring developers seeking their first job, as it demonstrates your skillset to potential employers.</p><h4>Here’s my advice:</h4><blockquote>Create hobby projects that utilize the technologies you’re currently learning. In my case, I built a School Management System to showcase my abilities.</blockquote><p>Since I live in a small city, Molde, I expected that my family and I might need to relocate to a larger city with more job opportunities, such as Oslo or Kristiansand. I sent a few CV to companies in Oslo, without any anwser.</p><p>However, after a few months, I discovered a suitable job opening in Molde itself. I sent my CV, and the recruitment process began. After some e-mail conversations, they asked me about my certifications and hobby projects.</p><p>I was nervous to show my Github repository, but fortunately it was good enough to land me an initial interview that was intended to check my skills in Norwegian, I’m not fluent in Norwegian, but fortunately good enough to go to the next step.</p><p>They invited me to visit their agency. I got a few small tasks in SASS/CSS and JavaScript, and I fixed all of them. At the end of the day, I spoke with the leader, and she said they would give me an answer in a few weeks.</p><p>It was looooong weeks for me, but I got a <strong>positive</strong> answer!</p><h3>What is important to get a developer job in Norway?</h3><p>Now, in 2024 it looks like marked is not as good as earlier. There are much more developers than few year ago. In my opinion there is a few things to remember:</p><ul><li><strong>Norwegian language </strong>— yes, it’s is very important. You can’t expect to speak English on meetings with clients. It’s is not professional in my opinion. Howewer I know some people who got a job without knowing Norwegian</li><li><strong>Work in office </strong>— event if it’s normall to work remote these days, I think it is important to start the job in the office with other developers, especialy for begginers</li><li><strong>Want to learn</strong> — personally, I think this is the most important. IT field is very dynamically and if you want be good, you need to learn all the time</li></ul><h3>Where search for job?</h3><p>There is few websites you can start explore for find a job:<br><a href="https://www.finn.no/job/fulltime/search.html?q=web+developer">Finn.no</a><br><a href="https://www.linkedin.com/jobs/search/?geoId=103819153&amp;keywords=web%20developer&amp;location=Norway&amp;origin=JOB_SEARCH_PAGE_LOCATION_AUTOCOMPLETE&amp;refresh=true&amp;position=1&amp;pageNum=0">LinkedIn</a><br><a href="https://www.indeed.com/jobs?q=web+developer&amp;l=norway&amp;vjk=bd79412b3d955295">Indeed.com</a></p><h3><strong>Summary</strong></h3><p>That is my story how I got my developer job in Norway. I hope you enjoyed this post, <strong>thanks for reading</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aefcce612408" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PHP with Vite and Vue — simple implementation]]></title>
            <link>https://medium.com/@witkowski.bartlomiej1/php-with-vite-and-vue-simple-implementation-1c90af6f5b9e?source=rss-59013506d0bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c90af6f5b9e</guid>
            <category><![CDATA[vitejs]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Bartlomiej Witkowski]]></dc:creator>
            <pubDate>Tue, 05 Mar 2024 18:28:32 GMT</pubDate>
            <atom:updated>2024-06-01T18:36:42.542Z</atom:updated>
            <content:encoded><![CDATA[<h3>PHP with Vite and Vue — simple implementation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lgHHH-dyzh-f5waJnORtbw.png" /></figure><p>Det tar bare noen få sekunder å gi en stjerne, og det betyr mye for oss. Klikk på stjerneikonet i øverste høyre hjørne av prosjektets GitHub-side.</p><p>I want to share with you a how you can integrate Vite with PHP. Remember that application is simplified just for show how you can use Vite in PHP.</p><p>I was looking for a simple Vite and PHP implementation on the internet, but unfortunately I found nothing that fits my needs. So, I decided to create one myself and I’d like to share it with you! You can find link to Github repository under.</p><h3>What is Vite.js?</h3><p>In simple words, it’s development tool which you can split into two major modes:</p><ul><li>development</li><li>production</li></ul><p>In development mode it uses local server for serve ES modules with hot replacement which updating modules during the execution of the application.</p><p>In production it uses bundled version of assets. For more detailed explanation, <a href="https://www.educative.io/answers/what-is-vitejs">read what is Vite.js</a></p><h3>Template</h3><p>Template has a following simple structure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*ollrU6BRToGuTxJJRLGgkA.png" /></figure><h3>How is it working?</h3><p>Take a look at the vite.config.js</p><pre>import { defineConfig, loadEnv } from &quot;vite&quot;;<br>import vue from &#39;@vitejs/plugin-vue&#39;<br>import liveReload from &#39;vite-plugin-live-reload&#39;;<br>import dotenv from &#39;dotenv&#39;;<br>import fs from &#39;fs&#39;;<br><br>// https://vitejs.dev/config/<br>export default ({ mode }) =&gt; {<br>    Object.assign(process.env, dotenv.parse(fs.readFileSync(`${__dirname}/.env`)));<br>    const port = process.env.VITE_PORT;<br>    const origin = `${process.env.VITE_ORIGIN}:${port}`;<br>    return defineConfig({<br>        plugins: [<br>            // register vue plugin<br>            vue(),<br>            // register live reload plugin, for refreshing the browser on file changes<br>            liveReload([<br>                __dirname + &#39;/templates/**/*.php&#39;,<br>            ]),<br>        ],<br>        base: &#39;./&#39;,<br>        // config for the build<br>        build: {<br>            manifest: &quot;manifest.json&quot;,<br>            outDir: &#39;web/resources/&#39;,<br>            rollupOptions: {<br>                input: {<br>                    js: &#39;./resources/js/app.js&#39;,<br>                    css: &#39;./resources/scss/app.scss&#39;,<br>                },<br>                output: {<br>                    entryFileNames: `js/app.js`,<br>                    /* assetFileNames: `[ext]/app.[ext]`, */<br>                    assetFileNames: ({name}) =&gt; {<br><br>                        if (/\.(gif|jpe?g|png|svg)$/.test(name ?? &#39;&#39;)){<br>                            return &#39;images/[name].[ext]&#39;;<br>                        }<br>                        <br>                        if (/\.css$/.test(name ?? &#39;&#39;)) {<br>                            return &#39;css/app.[ext]&#39;;   <br>                        }<br>               <br>                        return &#39;[name].[ext]&#39;;<br>                      },<br>                },<br>            },<br>        },<br>        // config for the dev server<br>        server: {<br>            // force to use the port from the .env file<br>            strictPort: true,<br>            port: port,<br><br>            // define source of the images<br>            origin: origin,<br>            hmr: {<br>                host: &#39;localhost&#39;,<br>            },<br>        },<br>        resolve: {<br>            alias: {<br>                vue: &#39;vue/dist/vue.esm-bundler.js&#39;<br>            }<br>        }<br>    })<br>}</pre><p>In simple words, this config registers plugin for Vue which we need to read Vue SFC files (.vue) and LiveReload for refreshing the browser on file changes. As you can see there is also <em>build</em> and <em>server </em>part<em>. </em>First one is used when we are runing “npm run build” , while <em>server </em>is used<em> </em>after<em> </em>“npm run dev” command. Development server is listening on host and port we registered in .env file. For example: <a href="http://localhost:5173/resources/js/app.js">http://localhost:5173</a></p><p>In webroot folder you can find index.php which is entry point of our application from the web.</p><pre>use Dotenv\Dotenv;<br><br>define(&#39;BASE_PATH&#39;, dirname(__DIR__));<br>define(&#39;VENDOR_PATH&#39;, BASE_PATH.&#39;/vendor&#39;);<br><br><br>// Load Composer&#39;s autoloader<br>require_once VENDOR_PATH.&#39;/autoload.php&#39;;<br><br><br>if (class_exists(&#39;Dotenv\Dotenv&#39;) &amp;&amp; file_exists(BASE_PATH . &#39;/.env&#39;)) {<br>    $dotenv = Dotenv::createImmutable(BASE_PATH);<br>    $dotenv-&gt;load();<br>}<br><br>// Run the application!<br><br>include BASE_PATH.&#39;/templates/page.php&#39;;</pre><p>It loads composer dependencies and .env file. Then it runs application.</p><p>In page.php we need to imports Vite config inside head tags:</p><pre>&lt;head&gt;<br>    // other scripts<br><br>    &lt;?php include BASE_PATH . &#39;/templates/parts/_vite.php&#39;; ?&gt;<br><br>    // other scripts<br>&lt;/head&gt;</pre><p>In the included file _vite.php, we check the environment and include the relevant scripts based on that environment:</p><pre>&lt;?php $isDev = isset($_ENV[&#39;ENVIRONMENT&#39;]) &amp;&amp; $_ENV[&#39;ENVIRONMENT&#39;] === &#39;dev&#39; &amp;&amp; isset($_ENV[&#39;VITE_PORT&#39;]) ?&gt;<br><br>&lt;?php if($isDev) : ?&gt;  <br>    &lt;script type=&quot;module&quot; src=&quot;&lt;?php echo $_ENV[&#39;VITE_ORIGIN&#39;] ?&gt;:&lt;?php echo $_ENV[&#39;VITE_PORT&#39;] ?&gt;/@vite/client&quot;&gt;&lt;/script&gt;<br>    &lt;script type=&quot;module&quot; src=&quot;&lt;?php echo $_ENV[&#39;VITE_ORIGIN&#39;] ?&gt;:&lt;?php echo  $_ENV[&#39;VITE_PORT&#39;] ?&gt;/resources/js/app.js&quot;&gt;&lt;/script&gt;<br>    &lt;script type=&quot;module&quot; src=&quot;&lt;?php echo $_ENV[&#39;VITE_ORIGIN&#39;] ?&gt;:&lt;?php echo  $_ENV[&#39;VITE_PORT&#39;] ?&gt;/resources/scss/app.scss&quot;&gt;&lt;/script&gt;<br>&lt;?php else: ?&gt;<br>    &lt;script type=&quot;module&quot; src=&quot;/resources/js/app.js&quot;&gt;&lt;/script&gt;<br>    &lt;link rel=&quot;stylesheet&quot; href=&quot;/resources/css/app.css&quot;&gt;<br>&lt;?php endif; ?&gt;</pre><h3>Support</h3><p>Did you find this article helpful? If so, I wolud really appreciate your support by giving the project a GitHub star!</p><p><a href="https://github.com/bar-tech-dev/php-vite">Here you can see project repository.</a></p><p>Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c90af6f5b9e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dont’t hardcode your website! Effortless customization with Craft CMS ]]></title>
            <link>https://medium.com/@witkowski.bartlomiej1/dontt-hardcode-your-website-effortless-customization-with-craft-cms-209725a6eb83?source=rss-59013506d0bb------2</link>
            <guid isPermaLink="false">https://medium.com/p/209725a6eb83</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[design-thinking]]></category>
            <category><![CDATA[craft-cms]]></category>
            <dc:creator><![CDATA[Bartlomiej Witkowski]]></dc:creator>
            <pubDate>Fri, 01 Mar 2024 12:20:36 GMT</pubDate>
            <atom:updated>2024-03-06T17:08:56.942Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>In my career as a web developer, I’ve noticed that clients often change their minds, even they were sure they love design. While modifying simple CSS styles requires coding, build, and deployment processes, I’ve come up with a simple solution that can make life easier.</strong></p><p>For those unfamiliar with Craft CMS, you can learn more about it <a href="http://www.craftcms.com/">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*R9v499rDB1Glw0A1n3eEXQ.png" /></figure><h3>Scenarios</h3><p><strong>Let’s consider first scenario:</strong></p><p>A client orders a website and agrees to the design and structure. You code it, and then, suddenly, the client changes his mind — he don’t like the colors. Is that frustrating? 🤬 For me, absolutely, it is!</p><p><strong>Take a look on second scenario:</strong></p><p>I have a client who gets bored quite often. He has an artistic soul and likes change the design every 6 months. Do we need to rewrite all the styles? Absolutely not! We can even give him the option to change colors, fonts and structure of website himself!</p><p>I found simple trick to change colors, fonts and page structure very quickly.</p><h3><strong>Example design</strong></h3><p>Let’s take a simple website that I created for this post’s purposes, which looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*UmG-EuT1lqNZbxmxMLVjEw.png" /></figure><h3>What should you avoid and how to write better CSS?</h3><p>Look at following snippet:</p><pre>.card{<br>  background: #ad8d85;<br>}<br><br>body{<br>  font-family: &#39;Montserrat&#39;, sans-serif;<br>}</pre><p>Don’t get me wrong, but writing CSS in this way is not the best solution. I know that a lot of people do it this way, including me in the past. 😊</p><p>The better way is following:</p><pre>card{<br>  background: var(--theme-primary-color);<br>}<br><br>body{<br>  font-family: var(--primary-font-family)<br>}</pre><p><strong>Why? It gives us a lot of flexibility!</strong></p><p>We can define our variables some place in CMS and change them dynamically. I’m assuming that you are familiar with Craft, so I will not explain in details.</p><p>Usually I’m creating a few color fields and <em>custom font field*</em>. Then I like to put them in global settings, like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WUlLjQNbuEkxwAfyM1Vb5Q.png" /></figure><p>Next define our variables in HTML head, something like:</p><pre>TWIG template<br>&lt;head&gt;<br>  {# ...other tags #}<br>  <br>  {% include &quot;parts/_css-variables&quot; %}<br>  {% include &quot;parts/_fonts&quot; %}<br><br>  {# ...other tags #}<br> &lt;/head&gt;</pre><pre>&lt;style type=&quot;text/css&quot;&gt;<br>    :root{<br>        --theme-primary-color: {{ settings.primaryColor }};<br>        --theme-secondary-color: {{ settings.secondaryColor }};<br>        --theme-tertiary-color: {{ settings.tertiaryColor }};<br>        --theme-text-primary: {{ settings.textPrimary }};<br>        --theme-font-family-primary: {{ settings.fontFamily }};<br>    }<br>&lt;/style&gt;</pre><pre>&lt;link rel=&quot;preconnect&quot; href=&quot;https://fonts.googleapis.com&quot;&gt;<br>&lt;link rel=&quot;preconnect&quot; href=&quot;https://fonts.gstatic.com&quot; crossorigin&gt;<br>&lt;link href=&quot;https://fonts.googleapis.com/css2?family={{settings.fontFamily}}:wght@300;400;500;600;700&amp;&amp;display=swap&quot; rel=&quot;preload&quot; as=&quot;style&quot; onload=&quot;this.onload=null;this.rel=&#39;stylesheet&#39;&quot;&gt;</pre><p>Following setup allows us to give new fresh look very quickly. 🚀</p><p>If we change just images, customize colors and font (maybe also order of Matrix Blocks), we can get following result in seconds:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*GuNo8hOrr1krTNClqYyW6w.png" /></figure><h3>Be prepared!</h3><p><strong>That’s is my way to be more flexible, productive and more prepared for unexpected situations!</strong></p><p><strong>Thanks for reading! </strong>I hope you enjoyed this simple tutorial and let me know if you gonna use it!</p><p><em>*Let me know if you want to read how to create your own field in Craft CMS!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=209725a6eb83" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>